rpc server register funcs: return errors

This commit is contained in:
Adrien Delorme 2019-03-27 15:04:03 +01:00
parent e65115a7a0
commit 39a5e4e612
1 changed files with 16 additions and 16 deletions

View File

@ -58,56 +58,56 @@ func (s *Server) Close() error {
return nil
}
func (s *Server) RegisterArtifact(a packer.Artifact) {
s.server.RegisterName(DefaultArtifactEndpoint, &ArtifactServer{
func (s *Server) RegisterArtifact(a packer.Artifact) error {
return s.server.RegisterName(DefaultArtifactEndpoint, &ArtifactServer{
artifact: a,
})
}
func (s *Server) RegisterBuild(b packer.Build) {
s.server.RegisterName(DefaultBuildEndpoint, &BuildServer{
func (s *Server) RegisterBuild(b packer.Build) error {
return s.server.RegisterName(DefaultBuildEndpoint, &BuildServer{
build: b,
mux: s.mux,
})
}
func (s *Server) RegisterBuilder(b packer.Builder) {
s.server.RegisterName(DefaultBuilderEndpoint, &BuilderServer{
func (s *Server) RegisterBuilder(b packer.Builder) error {
return s.server.RegisterName(DefaultBuilderEndpoint, &BuilderServer{
builder: b,
mux: s.mux,
})
}
func (s *Server) RegisterCommunicator(c packer.Communicator) {
s.server.RegisterName(DefaultCommunicatorEndpoint, &CommunicatorServer{
func (s *Server) RegisterCommunicator(c packer.Communicator) error {
return s.server.RegisterName(DefaultCommunicatorEndpoint, &CommunicatorServer{
c: c,
mux: s.mux,
})
}
func (s *Server) RegisterHook(h packer.Hook) {
s.server.RegisterName(DefaultHookEndpoint, &HookServer{
func (s *Server) RegisterHook(h packer.Hook) error {
return s.server.RegisterName(DefaultHookEndpoint, &HookServer{
hook: h,
mux: s.mux,
})
}
func (s *Server) RegisterPostProcessor(p packer.PostProcessor) {
s.server.RegisterName(DefaultPostProcessorEndpoint, &PostProcessorServer{
func (s *Server) RegisterPostProcessor(p packer.PostProcessor) error {
return s.server.RegisterName(DefaultPostProcessorEndpoint, &PostProcessorServer{
mux: s.mux,
p: p,
})
}
func (s *Server) RegisterProvisioner(p packer.Provisioner) {
s.server.RegisterName(DefaultProvisionerEndpoint, &ProvisionerServer{
func (s *Server) RegisterProvisioner(p packer.Provisioner) error {
return s.server.RegisterName(DefaultProvisionerEndpoint, &ProvisionerServer{
mux: s.mux,
p: p,
})
}
func (s *Server) RegisterUi(ui packer.Ui) {
s.server.RegisterName(DefaultUiEndpoint, &UiServer{
func (s *Server) RegisterUi(ui packer.Ui) error {
return s.server.RegisterName(DefaultUiEndpoint, &UiServer{
ui: ui,
register: s.server.RegisterName,
})