api

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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)

View Source
var File_schedule_proto protoreflect.FileDescriptor
View Source
var Provides = wire.NewSet(New)

Functions

func New

func New(i *common.Inject) (s *grpc.Server, err error)

func RegisterAPIServer

func RegisterAPIServer(s grpc.ServiceRegistrar, srv APIServer)

Types

type API

type API struct {
	UnimplementedAPIServer
	*common.Inject
}

func (*API) Delete

func (x *API) Delete(ctx context.Context, req *DeleteRequest) (_ *empty.Empty, err error)

func (*API) Get

func (x *API) Get(ctx context.Context, req *GetRequest) (rep *GetReply, err error)

func (*API) Put

func (x *API) Put(ctx context.Context, req *Schedule) (_ *empty.Empty, err error)

func (*API) SetSchedule

func (x *API) SetSchedule(ctx context.Context, key string, opts []model.Job) (err error)

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) Descriptor() ([]byte, []int)

Deprecated: Use GetReply.ProtoReflect.Descriptor instead.

func (*GetReply) GetData

func (x *GetReply) GetData() map[string]*Schedule

func (*GetReply) ProtoMessage

func (*GetReply) ProtoMessage()

func (*GetReply) ProtoReflect

func (x *GetReply) ProtoReflect() protoreflect.Message

func (*GetReply) Reset

func (x *GetReply) Reset()

func (*GetReply) String

func (x *GetReply) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Job.ProtoReflect.Descriptor instead.

func (*Job) GetLastDate

func (x *Job) GetLastDate() int64

func (*Job) GetMode

func (x *Job) GetMode() string

func (*Job) GetNextDate

func (x *Job) GetNextDate() int64

func (*Job) GetOption

func (x *Job) GetOption() []byte

func (*Job) GetSpec

func (x *Job) GetSpec() string

func (*Job) ProtoMessage

func (*Job) ProtoMessage()

func (*Job) ProtoReflect

func (x *Job) ProtoReflect() protoreflect.Message

func (*Job) Reset

func (x *Job) Reset()

func (*Job) String

func (x *Job) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Schedule.ProtoReflect.Descriptor instead.

func (*Schedule) GetJobs

func (x *Schedule) GetJobs() []*Job

func (*Schedule) GetKey

func (x *Schedule) GetKey() string

func (*Schedule) ProtoMessage

func (*Schedule) ProtoMessage()

func (*Schedule) ProtoReflect

func (x *Schedule) ProtoReflect() protoreflect.Message

func (*Schedule) Reset

func (x *Schedule) Reset()

func (*Schedule) String

func (x *Schedule) String() string

type UnimplementedAPIServer

type UnimplementedAPIServer struct {
}

UnimplementedAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedAPIServer) Delete

func (UnimplementedAPIServer) Get

func (UnimplementedAPIServer) Put

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.

Jump to

Keyboard shortcuts

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