dscheduler

package
v0.0.0-...-8b28b63 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2018 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package dscheduler is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

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

func (*Empty) XXX_Merge

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

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

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

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

func (*Task) GetAction

func (m *Task) GetAction() string

func (*Task) GetCron

func (m *Task) GetCron() string

func (*Task) GetId

func (m *Task) GetId() uint32

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) Reset

func (m *Task) Reset()

func (*Task) String

func (m *Task) String() string

func (*Task) XXX_DiscardUnknown

func (m *Task) XXX_DiscardUnknown()

func (*Task) XXX_Marshal

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

func (*Task) XXX_Merge

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

func (*Task) XXX_Size

func (m *Task) XXX_Size() int

func (*Task) XXX_Unmarshal

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

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

func (*TaskList) GetTasks

func (m *TaskList) GetTasks() []*Task

func (*TaskList) ProtoMessage

func (*TaskList) ProtoMessage()

func (*TaskList) Reset

func (m *TaskList) Reset()

func (*TaskList) String

func (m *TaskList) String() string

func (*TaskList) XXX_DiscardUnknown

func (m *TaskList) XXX_DiscardUnknown()

func (*TaskList) XXX_Marshal

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

func (*TaskList) XXX_Merge

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

func (*TaskList) XXX_Size

func (m *TaskList) XXX_Size() int

func (*TaskList) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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