service

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDaemonServer

func RegisterDaemonServer(s *grpc.Server, srv DaemonServer)

Types

type DaemonClient

type DaemonClient interface {
	Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error)
	Shutdown(ctx context.Context, in *ShutdownRequest, opts ...grpc.CallOption) (*ShutdownResponse, error)
}

DaemonClient is the client API for Daemon service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewDaemonClient

func NewDaemonClient(cc *grpc.ClientConn) DaemonClient

type DaemonServer

type DaemonServer interface {
	Version(context.Context, *VersionRequest) (*VersionResponse, error)
	Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error)
}

DaemonServer is the server API for Daemon service.

type Server

type Server struct {
	// Termination is populated with requests from clients invoking the shutdown
	// method over RPC. It can be ignored by daemon host processes wishing to
	// ignore temination requests originating from clients. The channel is
	// buffered and non-blocking, so it doesn't need to be serviced by the
	// daemon host-process at all - additional incoming shutdown requests will
	// just bounce off once the channel is populated. We do this, instead of
	// closing the channel, because we can't close the channel multiple times.
	Termination chan struct{}
}

func New

func New() *Server

func (*Server) Shutdown

func (*Server) Version

func (s *Server) Version(_ context.Context, _ *VersionRequest) (*VersionResponse, error)

type ShutdownRequest

type ShutdownRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ShutdownRequest) Descriptor

func (*ShutdownRequest) Descriptor() ([]byte, []int)

func (*ShutdownRequest) ProtoMessage

func (*ShutdownRequest) ProtoMessage()

func (*ShutdownRequest) Reset

func (m *ShutdownRequest) Reset()

func (*ShutdownRequest) String

func (m *ShutdownRequest) String() string

func (*ShutdownRequest) XXX_DiscardUnknown

func (m *ShutdownRequest) XXX_DiscardUnknown()

func (*ShutdownRequest) XXX_Marshal

func (m *ShutdownRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ShutdownRequest) XXX_Merge

func (dst *ShutdownRequest) XXX_Merge(src proto.Message)

func (*ShutdownRequest) XXX_Size

func (m *ShutdownRequest) XXX_Size() int

func (*ShutdownRequest) XXX_Unmarshal

func (m *ShutdownRequest) XXX_Unmarshal(b []byte) error

type ShutdownResponse

type ShutdownResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ShutdownResponse) Descriptor

func (*ShutdownResponse) Descriptor() ([]byte, []int)

func (*ShutdownResponse) ProtoMessage

func (*ShutdownResponse) ProtoMessage()

func (*ShutdownResponse) Reset

func (m *ShutdownResponse) Reset()

func (*ShutdownResponse) String

func (m *ShutdownResponse) String() string

func (*ShutdownResponse) XXX_DiscardUnknown

func (m *ShutdownResponse) XXX_DiscardUnknown()

func (*ShutdownResponse) XXX_Marshal

func (m *ShutdownResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ShutdownResponse) XXX_Merge

func (dst *ShutdownResponse) XXX_Merge(src proto.Message)

func (*ShutdownResponse) XXX_Size

func (m *ShutdownResponse) XXX_Size() int

func (*ShutdownResponse) XXX_Unmarshal

func (m *ShutdownResponse) XXX_Unmarshal(b []byte) error

type VersionRequest

type VersionRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*VersionRequest) Descriptor

func (*VersionRequest) Descriptor() ([]byte, []int)

func (*VersionRequest) ProtoMessage

func (*VersionRequest) ProtoMessage()

func (*VersionRequest) Reset

func (m *VersionRequest) Reset()

func (*VersionRequest) String

func (m *VersionRequest) String() string

func (*VersionRequest) XXX_DiscardUnknown

func (m *VersionRequest) XXX_DiscardUnknown()

func (*VersionRequest) XXX_Marshal

func (m *VersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VersionRequest) XXX_Merge

func (dst *VersionRequest) XXX_Merge(src proto.Message)

func (*VersionRequest) XXX_Size

func (m *VersionRequest) XXX_Size() int

func (*VersionRequest) XXX_Unmarshal

func (m *VersionRequest) XXX_Unmarshal(b []byte) error

type VersionResponse

type VersionResponse struct {
	// TODO: Should we encapsulate these inside a Version message type, perhaps
	// in the mutagen package?
	Major                uint64   `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"`
	Minor                uint64   `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"`
	Patch                uint64   `protobuf:"varint,3,opt,name=patch,proto3" json:"patch,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*VersionResponse) Descriptor

func (*VersionResponse) Descriptor() ([]byte, []int)

func (*VersionResponse) GetMajor

func (m *VersionResponse) GetMajor() uint64

func (*VersionResponse) GetMinor

func (m *VersionResponse) GetMinor() uint64

func (*VersionResponse) GetPatch

func (m *VersionResponse) GetPatch() uint64

func (*VersionResponse) ProtoMessage

func (*VersionResponse) ProtoMessage()

func (*VersionResponse) Reset

func (m *VersionResponse) Reset()

func (*VersionResponse) String

func (m *VersionResponse) String() string

func (*VersionResponse) XXX_DiscardUnknown

func (m *VersionResponse) XXX_DiscardUnknown()

func (*VersionResponse) XXX_Marshal

func (m *VersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VersionResponse) XXX_Merge

func (dst *VersionResponse) XXX_Merge(src proto.Message)

func (*VersionResponse) XXX_Size

func (m *VersionResponse) XXX_Size() int

func (*VersionResponse) XXX_Unmarshal

func (m *VersionResponse) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL