Documentation
¶
Index ¶
- Constants
- Variables
- func Address() string
- func Init(c *LocalServerConfig)
- type Callback
- type Code
- type GoRequest
- func (*GoRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GoRequest) GetData() []byte
- func (x *GoRequest) GetMethod() string
- func (x *GoRequest) GetTraceId() string
- func (r *GoRequest) Marshal() []byte
- func (*GoRequest) ProtoMessage()
- func (x *GoRequest) ProtoReflect() protoreflect.Message
- func (x *GoRequest) Reset()
- func (x *GoRequest) String() string
- func (r *GoRequest) Unmarshal(data []byte) error
- type GoResponse
- func (*GoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GoResponse) GetCode() Code
- func (x *GoResponse) GetData() []byte
- func (x *GoResponse) GetTraceId() string
- func (r *GoResponse) Marshal() []byte
- func (*GoResponse) ProtoMessage()
- func (x *GoResponse) ProtoReflect() protoreflect.Message
- func (x *GoResponse) Reset()
- func (x *GoResponse) String() string
- func (r *GoResponse) Unmarshal(data []byte) error
- type LocalServer
- type LocalServerConfig
- type StatusError
Constants ¶
View Source
const (
Version = "v0.0.4"
)
Variables ¶
View Source
var ( Code_name = map[int32]string{ 0: "OK", 400: "InvalidRequest", 404: "MethodNotFound", 500: "InternalError", 501: "MethodNullResponse", } Code_value = map[string]int32{ "OK": 0, "InvalidRequest": 400, "MethodNotFound": 404, "InternalError": 500, "MethodNullResponse": 501, } )
Enum value maps for Code.
View Source
var File_goapplib_calling_proto protoreflect.FileDescriptor
Functions ¶
func Init ¶
func Init(c *LocalServerConfig)
Types ¶
type Callback ¶
type Callback interface {
OnAppCall(ctx context.Context, request *GoRequest) (response *GoResponse)
OnAppReady()
OnAppClose()
}
type Code ¶
type Code int32
func (Code) Descriptor ¶ added in v0.0.5
func (Code) Descriptor() protoreflect.EnumDescriptor
func (Code) EnumDescriptor
deprecated
added in
v0.0.5
func (Code) Number ¶ added in v0.0.5
func (x Code) Number() protoreflect.EnumNumber
func (Code) Type ¶ added in v0.0.5
func (Code) Type() protoreflect.EnumType
type GoRequest ¶ added in v0.0.5
type GoRequest struct {
TraceId string `protobuf:"bytes,1,opt,name=traceId,proto3" json:"traceId,omitempty"`
Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"`
Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
// contains filtered or unexported fields
}
func (*GoRequest) Descriptor
deprecated
added in
v0.0.5
func (*GoRequest) GetTraceId ¶ added in v0.0.5
func (*GoRequest) ProtoMessage ¶ added in v0.0.5
func (*GoRequest) ProtoMessage()
func (*GoRequest) ProtoReflect ¶ added in v0.0.5
func (x *GoRequest) ProtoReflect() protoreflect.Message
type GoResponse ¶ added in v0.0.5
type GoResponse struct {
TraceId string `protobuf:"bytes,1,opt,name=traceId,proto3" json:"traceId,omitempty"`
Code Code `protobuf:"varint,2,opt,name=code,proto3,enum=goapplib.Code" json:"code,omitempty"`
Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
// contains filtered or unexported fields
}
func CallApp ¶
func CallApp(req *GoRequest) *GoResponse
func (*GoResponse) Descriptor
deprecated
added in
v0.0.5
func (*GoResponse) Descriptor() ([]byte, []int)
Deprecated: Use GoResponse.ProtoReflect.Descriptor instead.
func (*GoResponse) GetCode ¶ added in v0.0.5
func (x *GoResponse) GetCode() Code
func (*GoResponse) GetData ¶ added in v0.0.5
func (x *GoResponse) GetData() []byte
func (*GoResponse) GetTraceId ¶ added in v0.0.5
func (x *GoResponse) GetTraceId() string
func (*GoResponse) Marshal ¶ added in v0.0.5
func (r *GoResponse) Marshal() []byte
func (*GoResponse) ProtoMessage ¶ added in v0.0.5
func (*GoResponse) ProtoMessage()
func (*GoResponse) ProtoReflect ¶ added in v0.0.5
func (x *GoResponse) ProtoReflect() protoreflect.Message
func (*GoResponse) Reset ¶ added in v0.0.5
func (x *GoResponse) Reset()
func (*GoResponse) String ¶ added in v0.0.5
func (x *GoResponse) String() string
func (*GoResponse) Unmarshal ¶ added in v0.0.5
func (r *GoResponse) Unmarshal(data []byte) error
type LocalServer ¶
type LocalServer struct {
Config *LocalServerConfig
// contains filtered or unexported fields
}
func NewLocalServer ¶
func NewLocalServer(config *LocalServerConfig) *LocalServer
func (*LocalServer) Start ¶
func (l *LocalServer) Start()
type LocalServerConfig ¶
func DefaultLocalServerConfig ¶
func DefaultLocalServerConfig() *LocalServerConfig
type StatusError ¶ added in v0.0.5
func ErrorAsStatusError ¶ added in v0.0.5
func ErrorAsStatusError(err error) (*StatusError, bool)
func NewStatusError ¶ added in v0.0.5
func NewStatusError(code Code, message string) *StatusError
func NewStatusErrorFromError ¶ added in v0.0.5
func NewStatusErrorFromError(code Code, err error) *StatusError
func NewStatusErrorf ¶ added in v0.0.5
func NewStatusErrorf(code Code, format string, args ...interface{}) *StatusError
func (*StatusError) Error ¶ added in v0.0.5
func (e *StatusError) Error() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.