Documentation ¶
Overview ¶
Package operator is a generated protocol buffer package.
It is generated from these files:
operator.proto
It has these top-level messages:
Request Response Call Source Room User
Index ¶
- Constants
- Variables
- func Camelize(s string, sep string) string
- func GetUserEmail(r Requester) string
- func NewHandler(ctx context.Context, inst Instrumenter, decoder Decoder, invoker Invoker, ...) (http.Handler, error)
- func NewUnaryServerInterceptor(auth Authorizer, inst Instrumenter) grpc.UnaryServerInterceptor
- func Send(ctx context.Context, s Sender, r Requester, msg *Message) error
- type Authorizer
- type Call
- func (*Call) Descriptor() ([]byte, []int)
- func (m *Call) GetArgs() map[string]string
- func (m *Call) GetDuration() *google_protobuf1.Duration
- func (m *Call) GetError() string
- func (m *Call) GetMethod() string
- func (m *Call) GetService() string
- func (*Call) ProtoMessage()
- func (m *Call) Reset()
- func (m *Call) String() string
- type Command
- type CommandContext
- type Decoder
- type Event
- type Instrumenter
- type Invoker
- type InvokerFunc
- type Message
- type MethodCommand
- type Request
- func (*Request) Descriptor() ([]byte, []int)
- func (m *Request) GetCall() *Call
- func (m *Request) GetOtp() string
- func (m *Request) GetSenderId() string
- func (m *Request) GetSource() *Source
- func (req *Request) GetUserEmail() string
- func (*Request) ProtoMessage()
- func (m *Request) Reset()
- func (m *Request) String() string
- type RequestSender
- type Requester
- type Response
- type Room
- type Sender
- type ServiceCommand
- type Source
- type SourceType
- type User
Constants ¶
View Source
const DefaultAddress = "localhost:9000"
View Source
const ReCommandMessage = `\A%s(?P<service>[\w|-]+)\s+(?P<method>[\w|\-]+)(?:\s+(?P<options>.*))?\z`
Variables ¶
View Source
var E_Enabled = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.ServiceOptions)(nil), ExtensionType: (*bool)(nil), Field: 51235, Name: "operator.enabled", Tag: "varint,51235,opt,name=enabled", Filename: "operator.proto", }
View Source
var E_Name = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.ServiceOptions)(nil), ExtensionType: (*string)(nil), Field: 51234, Name: "operator.name", Tag: "bytes,51234,opt,name=name", Filename: "operator.proto", }
View Source
var ErrInvalidRequest = errors.New("invalid rpc request")
View Source
var SourceType_name = map[int32]string{
0: "HUBOT",
1: "COMMAND",
}
View Source
var SourceType_value = map[string]int32{
"HUBOT": 0,
"COMMAND": 1,
}
Functions ¶
func GetUserEmail ¶
func NewHandler ¶
func NewUnaryServerInterceptor ¶
func NewUnaryServerInterceptor(auth Authorizer, inst Instrumenter) grpc.UnaryServerInterceptor
Types ¶
type Call ¶
type Call struct { Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"` Method string `protobuf:"bytes,2,opt,name=method" json:"method,omitempty"` Args map[string]string `` /* 128-byte string literal not displayed */ Error string `protobuf:"bytes,4,opt,name=error" json:"error,omitempty"` Duration *google_protobuf1.Duration `protobuf:"bytes,5,opt,name=duration" json:"duration,omitempty"` }
Call represents a completed gRPC call. The Error field will be non-nil if it resulted in an error.
func (*Call) Descriptor ¶
func (*Call) GetDuration ¶
func (m *Call) GetDuration() *google_protobuf1.Duration
func (*Call) GetService ¶
func (*Call) ProtoMessage ¶
func (*Call) ProtoMessage()
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func NewCommand ¶
func NewCommand(name string, services []ServiceCommand) Command
type CommandContext ¶
func (*CommandContext) GetConn ¶
func (c *CommandContext) GetConn() (*grpc.ClientConn, error)
type Instrumenter ¶
type Instrumenter interface {
Instrument(*Event)
}
type Invoker ¶
func NewInvoker ¶
func NewInvoker( conn *grpc.ClientConn, inst Instrumenter, sender Sender, f InvokerFunc, timeout time.Duration, pkg string, errMsgOpts interface{}, ) Invoker
type InvokerFunc ¶
type MethodCommand ¶
type Request ¶
type Request struct { Source *Source `protobuf:"bytes,1,opt,name=source" json:"source,omitempty"` Call *Call `protobuf:"bytes,2,opt,name=call" json:"call,omitempty"` SenderId string `protobuf:"bytes,3,opt,name=sender_id,json=senderId" json:"sender_id,omitempty"` Otp string `protobuf:"bytes,4,opt,name=otp" json:"otp,omitempty"` }
func (*Request) Descriptor ¶
func (*Request) GetSenderId ¶
func (*Request) GetUserEmail ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
type RequestSender ¶
type RequestSender struct {
// contains filtered or unexported fields
}
func GetSender ¶
func GetSender(s Sender, r Requester) *RequestSender
type Response ¶
type Response struct {
Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}
func (*Response) Descriptor ¶
func (*Response) GetMessage ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
type Room ¶
type Room struct { Id int64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` }
func (*Room) Descriptor ¶
func (*Room) ProtoMessage ¶
func (*Room) ProtoMessage()
type ServiceCommand ¶
type ServiceCommand struct { Name string Synopsis string Methods []MethodCommand }
type Source ¶
type Source struct { Type SourceType `protobuf:"varint,1,opt,name=type,enum=operator.SourceType" json:"type,omitempty"` User *User `protobuf:"bytes,2,opt,name=user" json:"user,omitempty"` Room *Room `protobuf:"bytes,3,opt,name=room" json:"room,omitempty"` Hostname string `protobuf:"bytes,4,opt,name=hostname" json:"hostname,omitempty"` }
func (*Source) Descriptor ¶
func (*Source) GetHostname ¶
func (*Source) GetType ¶
func (m *Source) GetType() SourceType
func (*Source) ProtoMessage ¶
func (*Source) ProtoMessage()
type SourceType ¶
type SourceType int32
const ( SourceType_HUBOT SourceType = 0 SourceType_COMMAND SourceType = 1 )
func (SourceType) EnumDescriptor ¶
func (SourceType) EnumDescriptor() ([]byte, []int)
func (SourceType) String ¶
func (x SourceType) String() string
type User ¶
type User struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Login string `protobuf:"bytes,2,opt,name=login" json:"login,omitempty"` RealName string `protobuf:"bytes,3,opt,name=real_name,json=realName" json:"real_name,omitempty"` Email string `protobuf:"bytes,4,opt,name=email" json:"email,omitempty"` }
func (*User) Descriptor ¶
func (*User) GetRealName ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package generator generates Golang code from the input proto files then compiles the code into protobuf structures for use by the protoc executable.
|
Package generator generates Golang code from the input proto files then compiles the code into protobuf structures for use by the protoc executable. |
Package operatortesting is a generated protocol buffer package.
|
Package operatortesting is a generated protocol buffer package. |
Click to show internal directories.
Click to hide internal directories.