rpc

package
v0.12.9 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2021 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const C_Authorization int64 = 3373514778
View Source
const C_Bool int64 = 4122188204
View Source
const C_CreateRequest int64 = 2229707971
View Source
const C_DeleteRequest int64 = 4088608791
View Source
const C_GetRequest int64 = 3359917651
View Source
const C_ListRequest int64 = 307567737
View Source
const C_LoginRequest int64 = 3796676066
View Source
const C_RegisterRequest int64 = 913053684
View Source
const C_TaskManagerCreate int64 = 613086944
View Source
const C_TaskManagerDelete int64 = 2437835420
View Source
const C_TaskManagerGet int64 = 1803980423
View Source
const C_TaskManagerList int64 = 1736909319
View Source
const C_TaskManagerLogin int64 = 656640319
View Source
const C_TaskManagerRegister int64 = 35362179
View Source
const C_TaskView int64 = 2236647323
View Source
const C_TaskViewMany int64 = 2061119489

Variables

View Source
var File_task_manager_proto protoreflect.FileDescriptor
View Source
var PoolAuthorization = poolAuthorization{}
View Source
var PoolBool = poolBool{}
View Source
var PoolCreateRequest = poolCreateRequest{}
View Source
var PoolDeleteRequest = poolDeleteRequest{}
View Source
var PoolGetRequest = poolGetRequest{}
View Source
var PoolListRequest = poolListRequest{}
View Source
var PoolLoginRequest = poolLoginRequest{}
View Source
var PoolRegisterRequest = poolRegisterRequest{}
View Source
var PoolTaskView = poolTaskView{}
View Source
var PoolTaskViewMany = poolTaskViewMany{}

Functions

func RegisterTaskManager

func RegisterTaskManager(h ITaskManager, e *edge.Server, preHandlers ...edge.Handler)

func RegisterTaskManagerCli

func RegisterTaskManagerCli(h ITaskManagerCli, c edgec.Client, rootCmd *cobra.Command)

func RegisterTaskManagerWithFunc

func RegisterTaskManagerWithFunc(h ITaskManager, e *edge.Server, handlerFunc func(c int64) []edge.Handler)

func TunnelRequestTaskManagerCreate

func TunnelRequestTaskManagerCreate(ctx *edge.RequestCtx, replicaSet uint64, req *CreateRequest, res *TaskView, kvs ...*rony.KeyValue) error

func TunnelRequestTaskManagerDelete

func TunnelRequestTaskManagerDelete(ctx *edge.RequestCtx, replicaSet uint64, req *DeleteRequest, res *Bool, kvs ...*rony.KeyValue) error

func TunnelRequestTaskManagerGet

func TunnelRequestTaskManagerGet(ctx *edge.RequestCtx, replicaSet uint64, req *GetRequest, res *TaskView, kvs ...*rony.KeyValue) error

func TunnelRequestTaskManagerList

func TunnelRequestTaskManagerList(ctx *edge.RequestCtx, replicaSet uint64, req *ListRequest, res *TaskViewMany, kvs ...*rony.KeyValue) error

func TunnelRequestTaskManagerLogin

func TunnelRequestTaskManagerLogin(ctx *edge.RequestCtx, replicaSet uint64, req *LoginRequest, res *Authorization, kvs ...*rony.KeyValue) error

func TunnelRequestTaskManagerRegister

func TunnelRequestTaskManagerRegister(ctx *edge.RequestCtx, replicaSet uint64, req *RegisterRequest, res *Authorization, kvs ...*rony.KeyValue) error

Types

type Authorization

type Authorization struct {
	SessionID string `protobuf:"bytes,1,opt,name=SessionID,proto3" json:"SessionID,omitempty"`
	// contains filtered or unexported fields
}

Authorization

func (*Authorization) Clone

func (x *Authorization) Clone() *Authorization

func (*Authorization) DeepCopy

func (x *Authorization) DeepCopy(z *Authorization)

func (*Authorization) Descriptor deprecated

func (*Authorization) Descriptor() ([]byte, []int)

Deprecated: Use Authorization.ProtoReflect.Descriptor instead.

func (*Authorization) GetSessionID

func (x *Authorization) GetSessionID() string

func (*Authorization) Marshal

func (x *Authorization) Marshal() ([]byte, error)

func (*Authorization) MarshalJSON

func (x *Authorization) MarshalJSON() ([]byte, error)

func (*Authorization) ProtoMessage

func (*Authorization) ProtoMessage()

func (*Authorization) ProtoReflect

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

func (*Authorization) PushToContext

func (x *Authorization) PushToContext(ctx *edge.RequestCtx)

func (*Authorization) Reset

func (x *Authorization) Reset()

func (*Authorization) String

func (x *Authorization) String() string

func (*Authorization) Unmarshal

func (x *Authorization) Unmarshal(b []byte) error

func (*Authorization) UnmarshalJSON

func (x *Authorization) UnmarshalJSON(b []byte) error

type Bool

type Bool struct {
	Result bool `protobuf:"varint,1,opt,name=Result,proto3" json:"Result,omitempty"`
	// contains filtered or unexported fields
}

func (*Bool) Clone

func (x *Bool) Clone() *Bool

func (*Bool) DeepCopy

func (x *Bool) DeepCopy(z *Bool)

func (*Bool) Descriptor deprecated

func (*Bool) Descriptor() ([]byte, []int)

Deprecated: Use Bool.ProtoReflect.Descriptor instead.

func (*Bool) GetResult

func (x *Bool) GetResult() bool

func (*Bool) Marshal

func (x *Bool) Marshal() ([]byte, error)

func (*Bool) MarshalJSON

func (x *Bool) MarshalJSON() ([]byte, error)

func (*Bool) ProtoMessage

func (*Bool) ProtoMessage()

func (*Bool) ProtoReflect

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

func (*Bool) PushToContext

func (x *Bool) PushToContext(ctx *edge.RequestCtx)

func (*Bool) Reset

func (x *Bool) Reset()

func (*Bool) String

func (x *Bool) String() string

func (*Bool) Unmarshal

func (x *Bool) Unmarshal(b []byte) error

func (*Bool) UnmarshalJSON

func (x *Bool) UnmarshalJSON(b []byte) error

type CreateRequest

type CreateRequest struct {
	Title   string   `protobuf:"bytes,1,opt,name=Title,proto3" json:"Title,omitempty"`
	TODOs   []string `protobuf:"bytes,2,rep,name=TODOs,proto3" json:"TODOs,omitempty"`
	DueDate int64    `protobuf:"varint,3,opt,name=DueDate,proto3" json:"DueDate,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateRequest) Clone

func (x *CreateRequest) Clone() *CreateRequest

func (*CreateRequest) DeepCopy

func (x *CreateRequest) DeepCopy(z *CreateRequest)

func (*CreateRequest) Descriptor deprecated

func (*CreateRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetDueDate

func (x *CreateRequest) GetDueDate() int64

func (*CreateRequest) GetTODOs

func (x *CreateRequest) GetTODOs() []string

func (*CreateRequest) GetTitle

func (x *CreateRequest) GetTitle() string

func (*CreateRequest) Marshal

func (x *CreateRequest) Marshal() ([]byte, error)

func (*CreateRequest) MarshalJSON

func (x *CreateRequest) MarshalJSON() ([]byte, error)

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) ProtoReflect

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

func (*CreateRequest) PushToContext

func (x *CreateRequest) PushToContext(ctx *edge.RequestCtx)

func (*CreateRequest) Reset

func (x *CreateRequest) Reset()

func (*CreateRequest) String

func (x *CreateRequest) String() string

func (*CreateRequest) Unmarshal

func (x *CreateRequest) Unmarshal(b []byte) error

func (*CreateRequest) UnmarshalJSON

func (x *CreateRequest) UnmarshalJSON(b []byte) error

type DeleteRequest

type DeleteRequest struct {
	TaskID int64 `protobuf:"varint,1,opt,name=TaskID,proto3" json:"TaskID,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteRequest) Clone

func (x *DeleteRequest) Clone() *DeleteRequest

func (*DeleteRequest) DeepCopy

func (x *DeleteRequest) DeepCopy(z *DeleteRequest)

func (*DeleteRequest) Descriptor deprecated

func (*DeleteRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetTaskID

func (x *DeleteRequest) GetTaskID() int64

func (*DeleteRequest) Marshal

func (x *DeleteRequest) Marshal() ([]byte, error)

func (*DeleteRequest) MarshalJSON

func (x *DeleteRequest) MarshalJSON() ([]byte, error)

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

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

func (*DeleteRequest) PushToContext

func (x *DeleteRequest) PushToContext(ctx *edge.RequestCtx)

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

func (*DeleteRequest) Unmarshal

func (x *DeleteRequest) Unmarshal(b []byte) error

func (*DeleteRequest) UnmarshalJSON

func (x *DeleteRequest) UnmarshalJSON(b []byte) error

type GetRequest

type GetRequest struct {
	TaskID int64 `protobuf:"varint,1,opt,name=TaskID,proto3" json:"TaskID,omitempty"`
	// contains filtered or unexported fields
}

func (*GetRequest) Clone

func (x *GetRequest) Clone() *GetRequest

func (*GetRequest) DeepCopy

func (x *GetRequest) DeepCopy(z *GetRequest)

func (*GetRequest) Descriptor deprecated

func (*GetRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetTaskID

func (x *GetRequest) GetTaskID() int64

func (*GetRequest) Marshal

func (x *GetRequest) Marshal() ([]byte, error)

func (*GetRequest) MarshalJSON

func (x *GetRequest) MarshalJSON() ([]byte, error)

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

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

func (*GetRequest) PushToContext

func (x *GetRequest) PushToContext(ctx *edge.RequestCtx)

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

func (*GetRequest) Unmarshal

func (x *GetRequest) Unmarshal(b []byte) error

func (*GetRequest) UnmarshalJSON

func (x *GetRequest) UnmarshalJSON(b []byte) error

type ITaskManager

type ITaskManager interface {
	Register(ctx *edge.RequestCtx, req *RegisterRequest, res *Authorization)
	Login(ctx *edge.RequestCtx, req *LoginRequest, res *Authorization)
	Create(ctx *edge.RequestCtx, req *CreateRequest, res *TaskView)
	Get(ctx *edge.RequestCtx, req *GetRequest, res *TaskView)
	Delete(ctx *edge.RequestCtx, req *DeleteRequest, res *Bool)
	List(ctx *edge.RequestCtx, req *ListRequest, res *TaskViewMany)
}

type ITaskManagerCli

type ITaskManagerCli interface {
	Register(cli *TaskManagerClient, cmd *cobra.Command, args []string) error
	Login(cli *TaskManagerClient, cmd *cobra.Command, args []string) error
	Create(cli *TaskManagerClient, cmd *cobra.Command, args []string) error
	Get(cli *TaskManagerClient, cmd *cobra.Command, args []string) error
	Delete(cli *TaskManagerClient, cmd *cobra.Command, args []string) error
	List(cli *TaskManagerClient, cmd *cobra.Command, args []string) error
}

type ListRequest

type ListRequest struct {
	Offset int32 `protobuf:"varint,1,opt,name=Offset,proto3" json:"Offset,omitempty"`
	Limit  int32 `protobuf:"varint,2,opt,name=Limit,proto3" json:"Limit,omitempty"`
	// contains filtered or unexported fields
}

func (*ListRequest) Clone

func (x *ListRequest) Clone() *ListRequest

func (*ListRequest) DeepCopy

func (x *ListRequest) DeepCopy(z *ListRequest)

func (*ListRequest) Descriptor deprecated

func (*ListRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetLimit

func (x *ListRequest) GetLimit() int32

func (*ListRequest) GetOffset

func (x *ListRequest) GetOffset() int32

func (*ListRequest) Marshal

func (x *ListRequest) Marshal() ([]byte, error)

func (*ListRequest) MarshalJSON

func (x *ListRequest) MarshalJSON() ([]byte, error)

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

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

func (*ListRequest) PushToContext

func (x *ListRequest) PushToContext(ctx *edge.RequestCtx)

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

func (*ListRequest) Unmarshal

func (x *ListRequest) Unmarshal(b []byte) error

func (*ListRequest) UnmarshalJSON

func (x *ListRequest) UnmarshalJSON(b []byte) error

type LoginRequest

type LoginRequest struct {
	Username string `protobuf:"bytes,1,opt,name=Username,proto3" json:"Username,omitempty"`
	Password string `protobuf:"bytes,4,opt,name=Password,proto3" json:"Password,omitempty"`
	// contains filtered or unexported fields
}

LoginRequest

func (*LoginRequest) Clone

func (x *LoginRequest) Clone() *LoginRequest

func (*LoginRequest) DeepCopy

func (x *LoginRequest) DeepCopy(z *LoginRequest)

func (*LoginRequest) Descriptor deprecated

func (*LoginRequest) Descriptor() ([]byte, []int)

Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.

func (*LoginRequest) GetPassword

func (x *LoginRequest) GetPassword() string

func (*LoginRequest) GetUsername

func (x *LoginRequest) GetUsername() string

func (*LoginRequest) Marshal

func (x *LoginRequest) Marshal() ([]byte, error)

func (*LoginRequest) MarshalJSON

func (x *LoginRequest) MarshalJSON() ([]byte, error)

func (*LoginRequest) ProtoMessage

func (*LoginRequest) ProtoMessage()

func (*LoginRequest) ProtoReflect

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

func (*LoginRequest) PushToContext

func (x *LoginRequest) PushToContext(ctx *edge.RequestCtx)

func (*LoginRequest) Reset

func (x *LoginRequest) Reset()

func (*LoginRequest) String

func (x *LoginRequest) String() string

func (*LoginRequest) Unmarshal

func (x *LoginRequest) Unmarshal(b []byte) error

func (*LoginRequest) UnmarshalJSON

func (x *LoginRequest) UnmarshalJSON(b []byte) error

type RegisterRequest

type RegisterRequest struct {
	Username  string `protobuf:"bytes,1,opt,name=Username,proto3" json:"Username,omitempty"`
	FirstName string `protobuf:"bytes,2,opt,name=FirstName,proto3" json:"FirstName,omitempty"`
	LastName  string `protobuf:"bytes,3,opt,name=LastName,proto3" json:"LastName,omitempty"`
	Password  string `protobuf:"bytes,4,opt,name=Password,proto3" json:"Password,omitempty"`
	// contains filtered or unexported fields
}

RegisterRequest

func (*RegisterRequest) Clone

func (x *RegisterRequest) Clone() *RegisterRequest

func (*RegisterRequest) DeepCopy

func (x *RegisterRequest) DeepCopy(z *RegisterRequest)

func (*RegisterRequest) Descriptor deprecated

func (*RegisterRequest) Descriptor() ([]byte, []int)

Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.

func (*RegisterRequest) GetFirstName

func (x *RegisterRequest) GetFirstName() string

func (*RegisterRequest) GetLastName

func (x *RegisterRequest) GetLastName() string

func (*RegisterRequest) GetPassword

func (x *RegisterRequest) GetPassword() string

func (*RegisterRequest) GetUsername

func (x *RegisterRequest) GetUsername() string

func (*RegisterRequest) Marshal

func (x *RegisterRequest) Marshal() ([]byte, error)

func (*RegisterRequest) MarshalJSON

func (x *RegisterRequest) MarshalJSON() ([]byte, error)

func (*RegisterRequest) ProtoMessage

func (*RegisterRequest) ProtoMessage()

func (*RegisterRequest) ProtoReflect

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

func (*RegisterRequest) PushToContext

func (x *RegisterRequest) PushToContext(ctx *edge.RequestCtx)

func (*RegisterRequest) Reset

func (x *RegisterRequest) Reset()

func (*RegisterRequest) String

func (x *RegisterRequest) String() string

func (*RegisterRequest) Unmarshal

func (x *RegisterRequest) Unmarshal(b []byte) error

func (*RegisterRequest) UnmarshalJSON

func (x *RegisterRequest) UnmarshalJSON(b []byte) error

type TaskManager

type TaskManager struct {
	// contains filtered or unexported fields
}

func NewTaskManager

func NewTaskManager(s rony.Store) *TaskManager

func (*TaskManager) CheckSession

func (tm *TaskManager) CheckSession(ctx *edge.RequestCtx, in *rony.MessageEnvelope)

CheckSession is a middleware try to load the user info from the session id.

func (*TaskManager) Create

func (tm *TaskManager) Create(ctx *edge.RequestCtx, req *CreateRequest, res *TaskView)

func (*TaskManager) Delete

func (tm *TaskManager) Delete(ctx *edge.RequestCtx, req *DeleteRequest, res *Bool)

func (*TaskManager) Get

func (tm *TaskManager) Get(ctx *edge.RequestCtx, req *GetRequest, res *TaskView)

func (*TaskManager) List

func (tm *TaskManager) List(ctx *edge.RequestCtx, req *ListRequest, res *TaskViewMany)

func (*TaskManager) Login

func (tm *TaskManager) Login(ctx *edge.RequestCtx, req *LoginRequest, res *Authorization)

func (*TaskManager) MustAuthorized

func (tm *TaskManager) MustAuthorized(ctx *edge.RequestCtx, in *rony.MessageEnvelope)

MustAuthorized is a middleware to make sure the following handlers are only executed if a valid session id was provided in the request

func (*TaskManager) Register

func (tm *TaskManager) Register(ctx *edge.RequestCtx, req *RegisterRequest, res *Authorization)

type TaskManagerClient

type TaskManagerClient struct {
	// contains filtered or unexported fields
}

func NewTaskManagerClient

func NewTaskManagerClient(ec edgec.Client) *TaskManagerClient

func (*TaskManagerClient) Create

func (c *TaskManagerClient) Create(req *CreateRequest, kvs ...*rony.KeyValue) (*TaskView, error)

func (*TaskManagerClient) Delete

func (c *TaskManagerClient) Delete(req *DeleteRequest, kvs ...*rony.KeyValue) (*Bool, error)

func (*TaskManagerClient) Get

func (c *TaskManagerClient) Get(req *GetRequest, kvs ...*rony.KeyValue) (*TaskView, error)

func (*TaskManagerClient) List

func (c *TaskManagerClient) List(req *ListRequest, kvs ...*rony.KeyValue) (*TaskViewMany, error)

func (*TaskManagerClient) Login

func (c *TaskManagerClient) Login(req *LoginRequest, kvs ...*rony.KeyValue) (*Authorization, error)

func (*TaskManagerClient) Register

func (c *TaskManagerClient) Register(req *RegisterRequest, kvs ...*rony.KeyValue) (*Authorization, error)

type TaskView

type TaskView struct {
	ID      int64    `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Title   string   `protobuf:"bytes,2,opt,name=Title,proto3" json:"Title,omitempty"`
	TODOs   []string `protobuf:"bytes,3,rep,name=TODOs,proto3" json:"TODOs,omitempty"`
	DueDate int64    `protobuf:"varint,4,opt,name=DueDate,proto3" json:"DueDate,omitempty"`
	// contains filtered or unexported fields
}

func (*TaskView) Clone

func (x *TaskView) Clone() *TaskView

func (*TaskView) DeepCopy

func (x *TaskView) DeepCopy(z *TaskView)

func (*TaskView) Descriptor deprecated

func (*TaskView) Descriptor() ([]byte, []int)

Deprecated: Use TaskView.ProtoReflect.Descriptor instead.

func (*TaskView) GetDueDate

func (x *TaskView) GetDueDate() int64

func (*TaskView) GetID

func (x *TaskView) GetID() int64

func (*TaskView) GetTODOs

func (x *TaskView) GetTODOs() []string

func (*TaskView) GetTitle

func (x *TaskView) GetTitle() string

func (*TaskView) Marshal

func (x *TaskView) Marshal() ([]byte, error)

func (*TaskView) MarshalJSON

func (x *TaskView) MarshalJSON() ([]byte, error)

func (*TaskView) ProtoMessage

func (*TaskView) ProtoMessage()

func (*TaskView) ProtoReflect

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

func (*TaskView) PushToContext

func (x *TaskView) PushToContext(ctx *edge.RequestCtx)

func (*TaskView) Reset

func (x *TaskView) Reset()

func (*TaskView) String

func (x *TaskView) String() string

func (*TaskView) Unmarshal

func (x *TaskView) Unmarshal(b []byte) error

func (*TaskView) UnmarshalJSON

func (x *TaskView) UnmarshalJSON(b []byte) error

type TaskViewMany

type TaskViewMany struct {
	Tasks []*TaskView `protobuf:"bytes,1,rep,name=Tasks,proto3" json:"Tasks,omitempty"`
	// contains filtered or unexported fields
}

func (*TaskViewMany) Clone

func (x *TaskViewMany) Clone() *TaskViewMany

func (*TaskViewMany) DeepCopy

func (x *TaskViewMany) DeepCopy(z *TaskViewMany)

func (*TaskViewMany) Descriptor deprecated

func (*TaskViewMany) Descriptor() ([]byte, []int)

Deprecated: Use TaskViewMany.ProtoReflect.Descriptor instead.

func (*TaskViewMany) GetTasks

func (x *TaskViewMany) GetTasks() []*TaskView

func (*TaskViewMany) Marshal

func (x *TaskViewMany) Marshal() ([]byte, error)

func (*TaskViewMany) MarshalJSON

func (x *TaskViewMany) MarshalJSON() ([]byte, error)

func (*TaskViewMany) ProtoMessage

func (*TaskViewMany) ProtoMessage()

func (*TaskViewMany) ProtoReflect

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

func (*TaskViewMany) PushToContext

func (x *TaskViewMany) PushToContext(ctx *edge.RequestCtx)

func (*TaskViewMany) Reset

func (x *TaskViewMany) Reset()

func (*TaskViewMany) String

func (x *TaskViewMany) String() string

func (*TaskViewMany) Unmarshal

func (x *TaskViewMany) Unmarshal(b []byte) error

func (*TaskViewMany) UnmarshalJSON

func (x *TaskViewMany) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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