Documentation
¶
Index ¶
- Variables
- func New(i *common.Inject) (s *grpc.Server, err error)
- func RegisterAPIServer(s grpc.ServiceRegistrar, srv APIServer)
- type API
- func (x *API) Delete(ctx context.Context, req *DeleteRequest) (_ *empty.Empty, err error)
- func (x *API) Get(ctx context.Context, req *GetRequest) (rep *GetReply, err error)
- func (x *API) Put(ctx context.Context, req *Schedule) (_ *empty.Empty, err error)
- func (x *API) SetSchedule(ctx context.Context, key string, opts []model.Job) (err error)
- type APIClient
- type APIServer
- type DeleteRequest
- type GetReply
- type GetRequest
- type Job
- func (*Job) Descriptor() ([]byte, []int)deprecated
- func (x *Job) GetLastDate() int64
- func (x *Job) GetMode() string
- func (x *Job) GetNextDate() int64
- func (x *Job) GetOption() []byte
- func (x *Job) GetSpec() string
- func (*Job) ProtoMessage()
- func (x *Job) ProtoReflect() protoreflect.Message
- func (x *Job) Reset()
- func (x *Job) String() string
- type Schedule
- type UnimplementedAPIServer
- type UnsafeAPIServer
Constants ¶
This section is empty.
Variables ¶
var API_ServiceDesc = grpc.ServiceDesc{ ServiceName: "schedule.API", HandlerType: (*APIServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Put", Handler: _API_Put_Handler, }, { MethodName: "Get", Handler: _API_Get_Handler, }, { MethodName: "Delete", Handler: _API_Delete_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "schedule.proto", }
API_ServiceDesc is the grpc.ServiceDesc for API service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_schedule_proto protoreflect.FileDescriptor
var Provides = wire.NewSet(New)
Functions ¶
func RegisterAPIServer ¶
func RegisterAPIServer(s grpc.ServiceRegistrar, srv APIServer)
Types ¶
type API ¶
type API struct {
UnimplementedAPIServer
*common.Inject
}
type APIClient ¶
type APIClient interface {
Put(ctx context.Context, in *Schedule, opts ...grpc.CallOption) (*emptypb.Empty, error)
Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetReply, error)
Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
APIClient is the client API for API 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 NewAPIClient ¶
func NewAPIClient(cc grpc.ClientConnInterface) APIClient
type APIServer ¶
type APIServer interface {
Put(context.Context, *Schedule) (*emptypb.Empty, error)
Get(context.Context, *GetRequest) (*GetReply, error)
Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error)
// contains filtered or unexported methods
}
APIServer is the server API for API service. All implementations must embed UnimplementedAPIServer for forward compatibility
type DeleteRequest ¶
type DeleteRequest struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
// contains filtered or unexported fields
}
func (*DeleteRequest) Descriptor
deprecated
func (*DeleteRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.
func (*DeleteRequest) GetKey ¶
func (x *DeleteRequest) GetKey() string
func (*DeleteRequest) ProtoMessage ¶
func (*DeleteRequest) ProtoMessage()
func (*DeleteRequest) ProtoReflect ¶
func (x *DeleteRequest) ProtoReflect() protoreflect.Message
func (*DeleteRequest) Reset ¶
func (x *DeleteRequest) Reset()
func (*DeleteRequest) String ¶
func (x *DeleteRequest) String() string
type GetReply ¶
type GetReply struct {
Data map[string]*Schedule `` /* 149-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*GetReply) Descriptor
deprecated
func (*GetReply) ProtoMessage ¶
func (*GetReply) ProtoMessage()
func (*GetReply) ProtoReflect ¶
func (x *GetReply) ProtoReflect() protoreflect.Message
type GetRequest ¶
type GetRequest struct {
Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"`
// contains filtered or unexported fields
}
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetKeys ¶
func (x *GetRequest) GetKeys() []string
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type Job ¶
type Job struct {
Spec string `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"`
Mode string `protobuf:"bytes,2,opt,name=mode,proto3" json:"mode,omitempty"`
Option []byte `protobuf:"bytes,3,opt,name=option,proto3" json:"option,omitempty"`
NextDate *int64 `protobuf:"varint,4,opt,name=next_date,json=nextDate,proto3,oneof" json:"next_date,omitempty"`
LastDate *int64 `protobuf:"varint,5,opt,name=last_date,json=lastDate,proto3,oneof" json:"last_date,omitempty"`
// contains filtered or unexported fields
}
func (*Job) Descriptor
deprecated
func (*Job) GetLastDate ¶
func (*Job) GetNextDate ¶
func (*Job) ProtoMessage ¶
func (*Job) ProtoMessage()
func (*Job) ProtoReflect ¶
func (x *Job) ProtoReflect() protoreflect.Message
type Schedule ¶
type Schedule struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Jobs []*Job `protobuf:"bytes,2,rep,name=jobs,proto3" json:"jobs,omitempty"`
// contains filtered or unexported fields
}
func (*Schedule) Descriptor
deprecated
func (*Schedule) ProtoMessage ¶
func (*Schedule) ProtoMessage()
func (*Schedule) ProtoReflect ¶
func (x *Schedule) ProtoReflect() protoreflect.Message
type UnimplementedAPIServer ¶
type UnimplementedAPIServer struct {
}
UnimplementedAPIServer must be embedded to have forward compatible implementations.
func (UnimplementedAPIServer) Delete ¶
func (UnimplementedAPIServer) Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error)
func (UnimplementedAPIServer) Get ¶
func (UnimplementedAPIServer) Get(context.Context, *GetRequest) (*GetReply, error)
type UnsafeAPIServer ¶
type UnsafeAPIServer interface {
// contains filtered or unexported methods
}
UnsafeAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to APIServer will result in compilation errors.