Documentation ¶
Overview ¶
Package dscheduler is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterSchedulerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSchedulerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SchedulerClient) error
- func RegisterSchedulerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSchedulerServer(s *grpc.Server, srv SchedulerServer)
- type Empty
- func (*Empty) Descriptor() ([]byte, []int)
- func (*Empty) ProtoMessage()
- func (m *Empty) Reset()
- func (m *Empty) String() string
- func (m *Empty) XXX_DiscardUnknown()
- func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Empty) XXX_Merge(src proto.Message)
- func (m *Empty) XXX_Size() int
- func (m *Empty) XXX_Unmarshal(b []byte) error
- type SchedulerClient
- type SchedulerServer
- type Task
- func (*Task) Descriptor() ([]byte, []int)
- func (m *Task) GetAction() string
- func (m *Task) GetCron() string
- func (m *Task) GetId() uint32
- func (*Task) ProtoMessage()
- func (m *Task) Reset()
- func (m *Task) String() string
- func (m *Task) XXX_DiscardUnknown()
- func (m *Task) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Task) XXX_Merge(src proto.Message)
- func (m *Task) XXX_Size() int
- func (m *Task) XXX_Unmarshal(b []byte) error
- type TaskList
- func (*TaskList) Descriptor() ([]byte, []int)
- func (m *TaskList) GetTasks() []*Task
- func (*TaskList) ProtoMessage()
- func (m *TaskList) Reset()
- func (m *TaskList) String() string
- func (m *TaskList) XXX_DiscardUnknown()
- func (m *TaskList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *TaskList) XXX_Merge(src proto.Message)
- func (m *TaskList) XXX_Size() int
- func (m *TaskList) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterSchedulerHandler ¶
func RegisterSchedulerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterSchedulerHandler registers the http handlers for service Scheduler to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSchedulerHandlerClient ¶
func RegisterSchedulerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SchedulerClient) error
RegisterSchedulerHandlerClient registers the http handlers for service Scheduler to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SchedulerClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SchedulerClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SchedulerClient" to call the correct interceptors.
func RegisterSchedulerHandlerFromEndpoint ¶
func RegisterSchedulerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterSchedulerHandlerFromEndpoint is same as RegisterSchedulerHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSchedulerServer ¶
func RegisterSchedulerServer(s *grpc.Server, srv SchedulerServer)
Types ¶
type Empty ¶
type Empty struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Dummy message for the case where no parameters needed
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) XXX_DiscardUnknown ¶
func (m *Empty) XXX_DiscardUnknown()
func (*Empty) XXX_Marshal ¶
func (*Empty) XXX_Unmarshal ¶
type SchedulerClient ¶
type SchedulerClient interface { // List scheduled tasks List(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TaskList, error) // Add new task to scheduler. // Returns same Task message with initialized id field Add(ctx context.Context, in *Task, opts ...grpc.CallOption) (*Task, error) // Remove task from scheduler. Only id field is significant // with this function. Other Task's fields are ignored. Remove(ctx context.Context, in *Task, opts ...grpc.CallOption) (*Empty, error) // Remove all scheduled tasks RemoveAll(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) }
SchedulerClient is the client API for Scheduler service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewSchedulerClient ¶
func NewSchedulerClient(cc *grpc.ClientConn) SchedulerClient
type SchedulerServer ¶
type SchedulerServer interface { // List scheduled tasks List(context.Context, *Empty) (*TaskList, error) // Add new task to scheduler. // Returns same Task message with initialized id field Add(context.Context, *Task) (*Task, error) // Remove task from scheduler. Only id field is significant // with this function. Other Task's fields are ignored. Remove(context.Context, *Task) (*Empty, error) // Remove all scheduled tasks RemoveAll(context.Context, *Empty) (*Empty, error) }
SchedulerServer is the server API for Scheduler service.
type Task ¶
type Task struct { Id uint32 `protobuf:"varint,10,opt,name=id,proto3" json:"id,omitempty"` Cron string `protobuf:"bytes,20,opt,name=cron,proto3" json:"cron,omitempty"` Action string `protobuf:"bytes,30,opt,name=action,proto3" json:"action,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Task) Descriptor ¶
func (*Task) ProtoMessage ¶
func (*Task) ProtoMessage()
func (*Task) XXX_DiscardUnknown ¶
func (m *Task) XXX_DiscardUnknown()
func (*Task) XXX_Unmarshal ¶
type TaskList ¶
type TaskList struct { Tasks []*Task `protobuf:"bytes,10,rep,name=tasks,proto3" json:"tasks,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*TaskList) Descriptor ¶
func (*TaskList) ProtoMessage ¶
func (*TaskList) ProtoMessage()
func (*TaskList) XXX_DiscardUnknown ¶
func (m *TaskList) XXX_DiscardUnknown()