Documentation
¶
Index ¶
- Constants
- func CatchPanics(r any) error
- func CatchResultUnwrapPanic(r any) error
- func ComponentConfigValidator(path, cfg string) error
- func Register(reg Registration)
- func RegisterSerializable[T AutoMarshal]()
- func WrapResultError(err error) error
- type AutoMarshal
- type Deserializer
- func (d *Deserializer) Any() any
- func (d *Deserializer) Bool() (val bool)
- func (d *Deserializer) Byte() (val byte)
- func (d *Deserializer) Bytes() (val []byte)
- func (d *Deserializer) Complex128() (val complex128)
- func (d *Deserializer) Complex64() (val complex64)
- func (d *Deserializer) Error() error
- func (d *Deserializer) Float32() (val float32)
- func (d *Deserializer) Float64() (val float64)
- func (d *Deserializer) Int() (val int)
- func (d *Deserializer) Int16() (val int16)
- func (d *Deserializer) Int32() (val int32)
- func (d *Deserializer) Int64() (val int64)
- func (d *Deserializer) Int8() (val int8)
- func (d *Deserializer) Len() int
- func (d *Deserializer) String() (val string)
- func (d *Deserializer) Uint() (val uint)
- func (d *Deserializer) Uint16() (val uint16)
- func (d *Deserializer) Uint32() (val uint32)
- func (d *Deserializer) Uint64() (val uint64)
- func (d *Deserializer) Uint8() (val uint8)
- func (d *Deserializer) UnmarshalProto(value proto.Message)
- type MethodCallHandle
- type MethodLabels
- type MethodMetrics
- type Registration
- type Serializable
- type Serialization
- type Serializer
- func (s *Serializer) Any(value AutoMarshal)
- func (s *Serializer) Bool(b bool)
- func (s *Serializer) Byte(val byte)
- func (s *Serializer) Bytes(val []byte)
- func (s *Serializer) Complex128(val complex128)
- func (s *Serializer) Complex64(val complex64)
- func (s *Serializer) Data() []byte
- func (s *Serializer) Error(err error)
- func (s *Serializer) Float32(val float32)
- func (s *Serializer) Float64(val float64)
- func (s *Serializer) Int(val int)
- func (s *Serializer) Int16(val int16)
- func (s *Serializer) Int32(val int32)
- func (s *Serializer) Int64(val int64)
- func (s *Serializer) Int8(val int8)
- func (s *Serializer) Len(l int)
- func (s *Serializer) MarshalProto(value proto.Message)
- func (s *Serializer) String(val string)
- func (s *Serializer) Uint(val uint)
- func (s *Serializer) Uint16(val uint16)
- func (s *Serializer) Uint32(val uint32)
- func (s *Serializer) Uint64(val uint64)
- func (s *Serializer) Uint8(val uint8)
- type Server
- type Stub
Constants ¶
View Source
const ( MethodCountsName = "service_akasar_method_count" MethodErrorCountsName = "service_akasar_method_error_count" MethodLatenciesName = "service_akasar_method_latency_micros" MethodBytesRequestName = "service_akasar_method_bytes_request" MethodBytesReplyName = "service_akasar_method_bytes_reply" )
Variables ¶
This section is empty.
Functions ¶
func CatchPanics ¶
func CatchResultUnwrapPanic ¶
func ComponentConfigValidator ¶
ComponentConfigValidator 检查component config
func Register ¶
func Register(reg Registration)
func RegisterSerializable ¶
func RegisterSerializable[T AutoMarshal]()
func WrapResultError ¶
Types ¶
type AutoMarshal ¶
type AutoMarshal interface {
AkasarMarshal(enc *Serializer)
AkasarUnmarshal(enc *Deserializer)
}
type Deserializer ¶
type Deserializer struct {
// contains filtered or unexported fields
}
func NewDeserializer ¶
func NewDeserializer(buf []byte) *Deserializer
func (*Deserializer) Any ¶
func (d *Deserializer) Any() any
func (*Deserializer) Bool ¶
func (d *Deserializer) Bool() (val bool)
func (*Deserializer) Byte ¶
func (d *Deserializer) Byte() (val byte)
func (*Deserializer) Bytes ¶
func (d *Deserializer) Bytes() (val []byte)
func (*Deserializer) Complex128 ¶
func (d *Deserializer) Complex128() (val complex128)
func (*Deserializer) Complex64 ¶
func (d *Deserializer) Complex64() (val complex64)
func (*Deserializer) Error ¶
func (d *Deserializer) Error() error
func (*Deserializer) Float32 ¶
func (d *Deserializer) Float32() (val float32)
func (*Deserializer) Float64 ¶
func (d *Deserializer) Float64() (val float64)
func (*Deserializer) Int ¶
func (d *Deserializer) Int() (val int)
func (*Deserializer) Int16 ¶
func (d *Deserializer) Int16() (val int16)
func (*Deserializer) Int32 ¶
func (d *Deserializer) Int32() (val int32)
func (*Deserializer) Int64 ¶
func (d *Deserializer) Int64() (val int64)
func (*Deserializer) Int8 ¶
func (d *Deserializer) Int8() (val int8)
func (*Deserializer) Len ¶
func (d *Deserializer) Len() int
func (*Deserializer) String ¶
func (d *Deserializer) String() (val string)
func (*Deserializer) Uint ¶
func (d *Deserializer) Uint() (val uint)
func (*Deserializer) Uint16 ¶
func (d *Deserializer) Uint16() (val uint16)
func (*Deserializer) Uint32 ¶
func (d *Deserializer) Uint32() (val uint32)
func (*Deserializer) Uint64 ¶
func (d *Deserializer) Uint64() (val uint64)
func (*Deserializer) Uint8 ¶
func (d *Deserializer) Uint8() (val uint8)
func (*Deserializer) UnmarshalProto ¶
func (d *Deserializer) UnmarshalProto(value proto.Message)
type MethodCallHandle ¶
type MethodCallHandle struct {
// contains filtered or unexported fields
}
type MethodLabels ¶
type MethodMetrics ¶
type MethodMetrics struct {
// contains filtered or unexported fields
}
func MethodMetricsFor ¶
func MethodMetricsFor(labels MethodLabels) *MethodMetrics
func (*MethodMetrics) Begin ¶
func (m *MethodMetrics) Begin() MethodCallHandle
func (*MethodMetrics) End ¶
func (m *MethodMetrics) End(h MethodCallHandle, failed bool, requestBytes, replyBytes int)
type Registration ¶
type Registration struct {
Name string // full package-prefixed component name
Iface reflect.Type
Impl reflect.Type
Routed bool // True if calls to this component should be routed
Listeners []string
NoRetry []int //indices of methods that should not be retried.
LocalStubFn func(impl any, caller string, tracer trace.Tracer) any
ClientStubFn func(stub Stub, caller string, tracer trace.Tracer) any
ServerStubFn func(impl any) Server
}
func Find ¶
func Find(name string) (*Registration, bool)
func Registered ¶
func Registered() []*Registration
type Serializable ¶
type Serialization ¶
type Serializer ¶
type Serializer struct {
// contains filtered or unexported fields
}
func NewSerializer ¶
func NewSerializer(size ...int) *Serializer
func (*Serializer) Any ¶
func (s *Serializer) Any(value AutoMarshal)
func (*Serializer) Bool ¶
func (s *Serializer) Bool(b bool)
func (*Serializer) Byte ¶
func (s *Serializer) Byte(val byte)
func (*Serializer) Bytes ¶
func (s *Serializer) Bytes(val []byte)
func (*Serializer) Complex128 ¶
func (s *Serializer) Complex128(val complex128)
func (*Serializer) Complex64 ¶
func (s *Serializer) Complex64(val complex64)
func (*Serializer) Data ¶
func (s *Serializer) Data() []byte
func (*Serializer) Error ¶
func (s *Serializer) Error(err error)
func (*Serializer) Float32 ¶
func (s *Serializer) Float32(val float32)
func (*Serializer) Float64 ¶
func (s *Serializer) Float64(val float64)
func (*Serializer) Int ¶
func (s *Serializer) Int(val int)
func (*Serializer) Int16 ¶
func (s *Serializer) Int16(val int16)
func (*Serializer) Int32 ¶
func (s *Serializer) Int32(val int32)
func (*Serializer) Int64 ¶
func (s *Serializer) Int64(val int64)
func (*Serializer) Int8 ¶
func (s *Serializer) Int8(val int8)
func (*Serializer) Len ¶
func (s *Serializer) Len(l int)
func (*Serializer) MarshalProto ¶
func (s *Serializer) MarshalProto(value proto.Message)
func (*Serializer) String ¶
func (s *Serializer) String(val string)
func (*Serializer) Uint ¶
func (s *Serializer) Uint(val uint)
func (*Serializer) Uint16 ¶
func (s *Serializer) Uint16(val uint16)
func (*Serializer) Uint32 ¶
func (s *Serializer) Uint32(val uint32)
func (*Serializer) Uint64 ¶
func (s *Serializer) Uint64(val uint64)
func (*Serializer) Uint8 ¶
func (s *Serializer) Uint8(val uint8)
Click to show internal directories.
Click to hide internal directories.