Documentation ¶
Index ¶
- Variables
- func RegisterGoserverServiceServer(s grpc.ServiceRegistrar, srv GoserverServiceServer)
- type Alive
- type ChooseLeadRequest
- type ChooseLeadResponse
- func (*ChooseLeadResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ChooseLeadResponse) GetChosen() string
- func (*ChooseLeadResponse) ProtoMessage()
- func (x *ChooseLeadResponse) ProtoReflect() protoreflect.Message
- func (x *ChooseLeadResponse) Reset()
- func (x *ChooseLeadResponse) String() string
- type ContextType
- func (ContextType) Descriptor() protoreflect.EnumDescriptor
- func (x ContextType) Enum() *ContextType
- func (ContextType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ContextType) Number() protoreflect.EnumNumber
- func (x ContextType) String() string
- func (ContextType) Type() protoreflect.EnumType
- type EmbeddedTest
- func (*EmbeddedTest) Descriptor() ([]byte, []int)deprecated
- func (x *EmbeddedTest) GetBlah() *Alive
- func (x *EmbeddedTest) GetTest() string
- func (*EmbeddedTest) ProtoMessage()
- func (x *EmbeddedTest) ProtoReflect() protoreflect.Message
- func (x *EmbeddedTest) Reset()
- func (x *EmbeddedTest) String() string
- type Empty
- type GoserverServiceClient
- type GoserverServiceServer
- type LeadState
- type MoteRequest
- type ReregisterRequest
- type ReregisterResponse
- type ServerConfig
- type ServerState
- type ShutdownRequest
- type ShutdownResponse
- type State
- func (*State) Descriptor() ([]byte, []int)deprecated
- func (x *State) GetFraction() float64
- func (x *State) GetKey() string
- func (x *State) GetText() string
- func (x *State) GetTimeDuration() int64
- func (x *State) GetTimeValue() int64
- func (x *State) GetValue() int64
- func (*State) ProtoMessage()
- func (x *State) ProtoReflect() protoreflect.Message
- func (x *State) Reset()
- func (x *State) String() string
- type TaskPeriod
- type UnimplementedGoserverServiceServer
- func (UnimplementedGoserverServiceServer) ChooseLead(context.Context, *ChooseLeadRequest) (*ChooseLeadResponse, error)
- func (UnimplementedGoserverServiceServer) IsAlive(context.Context, *Alive) (*Alive, error)
- func (UnimplementedGoserverServiceServer) Reregister(context.Context, *ReregisterRequest) (*ReregisterResponse, error)
- func (UnimplementedGoserverServiceServer) Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error)
- func (UnimplementedGoserverServiceServer) State(context.Context, *Empty) (*ServerState, error)
- type UnsafeGoserverServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( ContextType_name = map[int32]string{ 0: "UNKNOWN", 1: "REGULAR", 4: "MEDIUM", 2: "LONG", 3: "INFINITE", 5: "NO_TRACE", } ContextType_value = map[string]int32{ "UNKNOWN": 0, "REGULAR": 1, "MEDIUM": 4, "LONG": 2, "INFINITE": 3, "NO_TRACE": 5, } )
Enum value maps for ContextType.
var ( LeadState_name = map[int32]string{ 0: "ELECTING", 1: "FOLLOWER", 2: "LEADER", } LeadState_value = map[string]int32{ "ELECTING": 0, "FOLLOWER": 1, "LEADER": 2, } )
Enum value maps for LeadState.
var File_goserver_proto protoreflect.FileDescriptor
Functions ¶
func RegisterGoserverServiceServer ¶
func RegisterGoserverServiceServer(s grpc.ServiceRegistrar, srv GoserverServiceServer)
Types ¶
type Alive ¶
type Alive struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Alive) Descriptor
deprecated
func (*Alive) ProtoMessage ¶
func (*Alive) ProtoMessage()
func (*Alive) ProtoReflect ¶
func (x *Alive) ProtoReflect() protoreflect.Message
type ChooseLeadRequest ¶
type ChooseLeadRequest struct { Server string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` // contains filtered or unexported fields }
func (*ChooseLeadRequest) Descriptor
deprecated
func (*ChooseLeadRequest) Descriptor() ([]byte, []int)
Deprecated: Use ChooseLeadRequest.ProtoReflect.Descriptor instead.
func (*ChooseLeadRequest) GetServer ¶
func (x *ChooseLeadRequest) GetServer() string
func (*ChooseLeadRequest) ProtoMessage ¶
func (*ChooseLeadRequest) ProtoMessage()
func (*ChooseLeadRequest) ProtoReflect ¶
func (x *ChooseLeadRequest) ProtoReflect() protoreflect.Message
func (*ChooseLeadRequest) Reset ¶
func (x *ChooseLeadRequest) Reset()
func (*ChooseLeadRequest) String ¶
func (x *ChooseLeadRequest) String() string
type ChooseLeadResponse ¶
type ChooseLeadResponse struct { Chosen string `protobuf:"bytes,2,opt,name=chosen,proto3" json:"chosen,omitempty"` // contains filtered or unexported fields }
func (*ChooseLeadResponse) Descriptor
deprecated
func (*ChooseLeadResponse) Descriptor() ([]byte, []int)
Deprecated: Use ChooseLeadResponse.ProtoReflect.Descriptor instead.
func (*ChooseLeadResponse) GetChosen ¶
func (x *ChooseLeadResponse) GetChosen() string
func (*ChooseLeadResponse) ProtoMessage ¶
func (*ChooseLeadResponse) ProtoMessage()
func (*ChooseLeadResponse) ProtoReflect ¶
func (x *ChooseLeadResponse) ProtoReflect() protoreflect.Message
func (*ChooseLeadResponse) Reset ¶
func (x *ChooseLeadResponse) Reset()
func (*ChooseLeadResponse) String ¶
func (x *ChooseLeadResponse) String() string
type ContextType ¶
type ContextType int32
const ( ContextType_UNKNOWN ContextType = 0 ContextType_REGULAR ContextType = 1 ContextType_MEDIUM ContextType = 4 ContextType_LONG ContextType = 2 ContextType_INFINITE ContextType = 3 ContextType_NO_TRACE ContextType = 5 )
func (ContextType) Descriptor ¶
func (ContextType) Descriptor() protoreflect.EnumDescriptor
func (ContextType) Enum ¶
func (x ContextType) Enum() *ContextType
func (ContextType) EnumDescriptor
deprecated
func (ContextType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ContextType.Descriptor instead.
func (ContextType) Number ¶
func (x ContextType) Number() protoreflect.EnumNumber
func (ContextType) String ¶
func (x ContextType) String() string
func (ContextType) Type ¶
func (ContextType) Type() protoreflect.EnumType
type EmbeddedTest ¶
type EmbeddedTest struct { Blah *Alive `protobuf:"bytes,1,opt,name=blah,proto3" json:"blah,omitempty"` Test string `protobuf:"bytes,2,opt,name=test,proto3" json:"test,omitempty"` // contains filtered or unexported fields }
func (*EmbeddedTest) Descriptor
deprecated
func (*EmbeddedTest) Descriptor() ([]byte, []int)
Deprecated: Use EmbeddedTest.ProtoReflect.Descriptor instead.
func (*EmbeddedTest) GetBlah ¶
func (x *EmbeddedTest) GetBlah() *Alive
func (*EmbeddedTest) GetTest ¶
func (x *EmbeddedTest) GetTest() string
func (*EmbeddedTest) ProtoMessage ¶
func (*EmbeddedTest) ProtoMessage()
func (*EmbeddedTest) ProtoReflect ¶
func (x *EmbeddedTest) ProtoReflect() protoreflect.Message
func (*EmbeddedTest) Reset ¶
func (x *EmbeddedTest) Reset()
func (*EmbeddedTest) String ¶
func (x *EmbeddedTest) String() string
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type GoserverServiceClient ¶
type GoserverServiceClient interface { IsAlive(ctx context.Context, in *Alive, opts ...grpc.CallOption) (*Alive, error) State(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ServerState, error) Shutdown(ctx context.Context, in *ShutdownRequest, opts ...grpc.CallOption) (*ShutdownResponse, error) Reregister(ctx context.Context, in *ReregisterRequest, opts ...grpc.CallOption) (*ReregisterResponse, error) ChooseLead(ctx context.Context, in *ChooseLeadRequest, opts ...grpc.CallOption) (*ChooseLeadResponse, error) }
GoserverServiceClient is the client API for GoserverService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewGoserverServiceClient ¶
func NewGoserverServiceClient(cc grpc.ClientConnInterface) GoserverServiceClient
type GoserverServiceServer ¶
type GoserverServiceServer interface { IsAlive(context.Context, *Alive) (*Alive, error) State(context.Context, *Empty) (*ServerState, error) Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error) Reregister(context.Context, *ReregisterRequest) (*ReregisterResponse, error) ChooseLead(context.Context, *ChooseLeadRequest) (*ChooseLeadResponse, error) }
GoserverServiceServer is the server API for GoserverService service. All implementations should embed UnimplementedGoserverServiceServer for forward compatibility
type LeadState ¶
type LeadState int32
func (LeadState) Descriptor ¶
func (LeadState) Descriptor() protoreflect.EnumDescriptor
func (LeadState) EnumDescriptor
deprecated
func (LeadState) Number ¶
func (x LeadState) Number() protoreflect.EnumNumber
func (LeadState) Type ¶
func (LeadState) Type() protoreflect.EnumType
type MoteRequest ¶
type MoteRequest struct { Master bool `protobuf:"varint,1,opt,name=master,proto3" json:"master,omitempty"` // contains filtered or unexported fields }
func (*MoteRequest) Descriptor
deprecated
func (*MoteRequest) Descriptor() ([]byte, []int)
Deprecated: Use MoteRequest.ProtoReflect.Descriptor instead.
func (*MoteRequest) GetMaster ¶
func (x *MoteRequest) GetMaster() bool
func (*MoteRequest) ProtoMessage ¶
func (*MoteRequest) ProtoMessage()
func (*MoteRequest) ProtoReflect ¶
func (x *MoteRequest) ProtoReflect() protoreflect.Message
func (*MoteRequest) Reset ¶
func (x *MoteRequest) Reset()
func (*MoteRequest) String ¶
func (x *MoteRequest) String() string
type ReregisterRequest ¶
type ReregisterRequest struct {
// contains filtered or unexported fields
}
func (*ReregisterRequest) Descriptor
deprecated
func (*ReregisterRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReregisterRequest.ProtoReflect.Descriptor instead.
func (*ReregisterRequest) ProtoMessage ¶
func (*ReregisterRequest) ProtoMessage()
func (*ReregisterRequest) ProtoReflect ¶
func (x *ReregisterRequest) ProtoReflect() protoreflect.Message
func (*ReregisterRequest) Reset ¶
func (x *ReregisterRequest) Reset()
func (*ReregisterRequest) String ¶
func (x *ReregisterRequest) String() string
type ReregisterResponse ¶
type ReregisterResponse struct {
// contains filtered or unexported fields
}
func (*ReregisterResponse) Descriptor
deprecated
func (*ReregisterResponse) Descriptor() ([]byte, []int)
Deprecated: Use ReregisterResponse.ProtoReflect.Descriptor instead.
func (*ReregisterResponse) ProtoMessage ¶
func (*ReregisterResponse) ProtoMessage()
func (*ReregisterResponse) ProtoReflect ¶
func (x *ReregisterResponse) ProtoReflect() protoreflect.Message
func (*ReregisterResponse) Reset ¶
func (x *ReregisterResponse) Reset()
func (*ReregisterResponse) String ¶
func (x *ReregisterResponse) String() string
type ServerConfig ¶
type ServerConfig struct { Periods []*TaskPeriod `protobuf:"bytes,1,rep,name=periods,proto3" json:"periods,omitempty"` // contains filtered or unexported fields }
func (*ServerConfig) Descriptor
deprecated
func (*ServerConfig) Descriptor() ([]byte, []int)
Deprecated: Use ServerConfig.ProtoReflect.Descriptor instead.
func (*ServerConfig) GetPeriods ¶
func (x *ServerConfig) GetPeriods() []*TaskPeriod
func (*ServerConfig) ProtoMessage ¶
func (*ServerConfig) ProtoMessage()
func (*ServerConfig) ProtoReflect ¶
func (x *ServerConfig) ProtoReflect() protoreflect.Message
func (*ServerConfig) Reset ¶
func (x *ServerConfig) Reset()
func (*ServerConfig) String ¶
func (x *ServerConfig) String() string
type ServerState ¶
type ServerState struct { States []*State `protobuf:"bytes,1,rep,name=states,proto3" json:"states,omitempty"` // contains filtered or unexported fields }
func (*ServerState) Descriptor
deprecated
func (*ServerState) Descriptor() ([]byte, []int)
Deprecated: Use ServerState.ProtoReflect.Descriptor instead.
func (*ServerState) GetStates ¶
func (x *ServerState) GetStates() []*State
func (*ServerState) ProtoMessage ¶
func (*ServerState) ProtoMessage()
func (*ServerState) ProtoReflect ¶
func (x *ServerState) ProtoReflect() protoreflect.Message
func (*ServerState) Reset ¶
func (x *ServerState) Reset()
func (*ServerState) String ¶
func (x *ServerState) String() string
type ShutdownRequest ¶
type ShutdownRequest struct {
// contains filtered or unexported fields
}
func (*ShutdownRequest) Descriptor
deprecated
func (*ShutdownRequest) Descriptor() ([]byte, []int)
Deprecated: Use ShutdownRequest.ProtoReflect.Descriptor instead.
func (*ShutdownRequest) ProtoMessage ¶
func (*ShutdownRequest) ProtoMessage()
func (*ShutdownRequest) ProtoReflect ¶
func (x *ShutdownRequest) ProtoReflect() protoreflect.Message
func (*ShutdownRequest) Reset ¶
func (x *ShutdownRequest) Reset()
func (*ShutdownRequest) String ¶
func (x *ShutdownRequest) String() string
type ShutdownResponse ¶
type ShutdownResponse struct {
// contains filtered or unexported fields
}
func (*ShutdownResponse) Descriptor
deprecated
func (*ShutdownResponse) Descriptor() ([]byte, []int)
Deprecated: Use ShutdownResponse.ProtoReflect.Descriptor instead.
func (*ShutdownResponse) ProtoMessage ¶
func (*ShutdownResponse) ProtoMessage()
func (*ShutdownResponse) ProtoReflect ¶
func (x *ShutdownResponse) ProtoReflect() protoreflect.Message
func (*ShutdownResponse) Reset ¶
func (x *ShutdownResponse) Reset()
func (*ShutdownResponse) String ¶
func (x *ShutdownResponse) String() string
type State ¶
type State struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` TimeValue int64 `protobuf:"varint,2,opt,name=time_value,json=timeValue,proto3" json:"time_value,omitempty"` Value int64 `protobuf:"varint,3,opt,name=value,proto3" json:"value,omitempty"` Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"` Fraction float64 `protobuf:"fixed64,5,opt,name=fraction,proto3" json:"fraction,omitempty"` TimeDuration int64 `protobuf:"varint,6,opt,name=time_duration,json=timeDuration,proto3" json:"time_duration,omitempty"` // contains filtered or unexported fields }
func (*State) Descriptor
deprecated
func (*State) GetFraction ¶
func (*State) GetTimeDuration ¶
func (*State) GetTimeValue ¶
func (*State) ProtoMessage ¶
func (*State) ProtoMessage()
func (*State) ProtoReflect ¶
func (x *State) ProtoReflect() protoreflect.Message
type TaskPeriod ¶
type TaskPeriod struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Period int64 `protobuf:"varint,2,opt,name=period,proto3" json:"period,omitempty"` // contains filtered or unexported fields }
func (*TaskPeriod) Descriptor
deprecated
func (*TaskPeriod) Descriptor() ([]byte, []int)
Deprecated: Use TaskPeriod.ProtoReflect.Descriptor instead.
func (*TaskPeriod) GetKey ¶
func (x *TaskPeriod) GetKey() string
func (*TaskPeriod) GetPeriod ¶
func (x *TaskPeriod) GetPeriod() int64
func (*TaskPeriod) ProtoMessage ¶
func (*TaskPeriod) ProtoMessage()
func (*TaskPeriod) ProtoReflect ¶
func (x *TaskPeriod) ProtoReflect() protoreflect.Message
func (*TaskPeriod) Reset ¶
func (x *TaskPeriod) Reset()
func (*TaskPeriod) String ¶
func (x *TaskPeriod) String() string
type UnimplementedGoserverServiceServer ¶
type UnimplementedGoserverServiceServer struct { }
UnimplementedGoserverServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedGoserverServiceServer) ChooseLead ¶
func (UnimplementedGoserverServiceServer) ChooseLead(context.Context, *ChooseLeadRequest) (*ChooseLeadResponse, error)
func (UnimplementedGoserverServiceServer) Reregister ¶
func (UnimplementedGoserverServiceServer) Reregister(context.Context, *ReregisterRequest) (*ReregisterResponse, error)
func (UnimplementedGoserverServiceServer) Shutdown ¶
func (UnimplementedGoserverServiceServer) Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error)
func (UnimplementedGoserverServiceServer) State ¶
func (UnimplementedGoserverServiceServer) State(context.Context, *Empty) (*ServerState, error)
type UnsafeGoserverServiceServer ¶
type UnsafeGoserverServiceServer interface {
// contains filtered or unexported methods
}
UnsafeGoserverServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GoserverServiceServer will result in compilation errors.