Documentation
¶
Index ¶
- Variables
- func CheckImplements(atype reflect.Type, btype reflect.Type) bool
- func CheckImplementsOneOf(atype reflect.Type, types ...reflect.Type) bool
- func CheckIn(ftype reflect.Type, params ...reflect.Type) bool
- func CheckOut(ftype reflect.Type, params ...reflect.Type) bool
- func CompareType(atype reflect.Type, btype reflect.Type) bool
- func IsActorContextType(gtype reflect.Type) bool
- func IsErrorType(gtype reflect.Type) bool
- func IsMessageType(gtype reflect.Type) bool
- func MethodByName(v interface{}, name string) (reflect.Value, bool)
- func PostStopFunc(v interface{}) func(ActorContext) error
- func PostStopMethod(v interface{}) (reflect.Value, bool)
- func PreStartFunc(v interface{}) func(ActorContext) error
- func PreStartMethod(v interface{}) (reflect.Value, bool)
- func PtrValue(gvalue reflect.Value) reflect.Value
- func ReceiveFunc(v interface{}) func(ActorContext, Message)
- func ReceiveMethod(v interface{}) (reflect.Value, bool)
- type Actor
- type ActorContext
- type ActorExecutor
- type ActorHandler
- type ActorHandlerExecutor
- type ActorSettings
- type AsyncActor
- type Cache
- type DoneEvent
- type Error
- type LogLevel
- type Logger
- type Message
- type Option
- func (opt Option) Bool() (bool, bool)
- func (opt Option) Duration() (time.Duration, bool)
- func (opt Option) Float32() (float32, bool)
- func (opt Option) Float64() (float64, bool)
- func (opt Option) Int() (int, bool)
- func (opt Option) Int8() (int8, bool)
- func (opt Option) Int16() (int16, bool)
- func (opt Option) Int32() (int32, bool)
- func (opt Option) Int64() (int64, bool)
- func (opt Option) String() string
- func (opt Option) Time() (time.Time, bool)
- func (opt Option) Uint() (uint, bool)
- func (opt Option) Uint8() (uint8, bool)
- func (opt Option) Uint16() (uint16, bool)
- func (opt Option) Uint32() (uint32, bool)
- func (opt Option) Uint64() (uint64, bool)
- type Pusher
- type Receiver
- type ReceiverFunc
- type Ref
- type ServiceExecutor
- type Settings
- type Startable
- type Stopable
- type System
- type SystemSettings
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorType = reflect.TypeOf((*error)(nil)).Elem() ActorContextType = reflect.TypeOf((*ActorContext)(nil)).Elem() MessageType = reflect.TypeOf((*Message)(nil)).Elem() )
View Source
var (
ErrUnknownCommand = Errorln("", "unknown command")
)
Functions ¶
func CheckImplementsOneOf ¶
func IsActorContextType ¶
func IsErrorType ¶
func IsMessageType ¶
func PostStopFunc ¶
func PostStopFunc(v interface{}) func(ActorContext) error
func PostStopMethod ¶
func PreStartFunc ¶
func PreStartFunc(v interface{}) func(ActorContext) error
func PreStartMethod ¶
func ReceiveFunc ¶
func ReceiveFunc(v interface{}) func(ActorContext, Message)
func ReceiveMethod ¶
Types ¶
type Actor ¶
type Actor struct {
OnReceive func(ActorContext, Message)
OnStart func(ActorContext) error
OnStop func(ActorContext) error
Async bool
}
func (Actor) AsyncActor ¶
func (Actor) PostStop ¶
func (a Actor) PostStop(ctx ActorContext) error
func (Actor) PreStart ¶
func (a Actor) PreStart(ctx ActorContext) error
func (Actor) Receive ¶
func (a Actor) Receive(ctx ActorContext, msg Message)
type ActorContext ¶
type ActorExecutor ¶
type ActorHandler ¶
type ActorHandler interface {
Pusher
ActorHandlerExecutor
Name() string
Close()
Root() ActorHandler
Parent() (ActorHandler, bool)
Path() string
System() System
Log() Logger
Settings() Settings
Child(string) (ActorHandler, bool)
Children() []ActorHandler
CreateRef() Ref
Cache() Cache
}
type ActorHandlerExecutor ¶
type ActorHandlerExecutor interface {
ExecuteHandler(Receiver, string, ...Option) (ActorHandler, error)
}
type ActorSettings ¶
type AsyncActor ¶
type AsyncActor interface {
AsyncActor() bool
}
type Cache ¶
type Error ¶
type Error struct {
Code string `json:"code,omitempty"`
Message string `json:"error"`
Description string `json:"description,omitempty"`
Status int `json:"-"`
}
func (*Error) StatusCode ¶
func (*Error) WithDescription ¶
func (*Error) WithStatusCode ¶
type Logger ¶
type Logger interface {
ForName(string) Logger
Debug(...interface{})
Info(...interface{})
Warn(...interface{})
Error(...interface{})
Fatal(...interface{})
Panic(...interface{})
Debugf(string, ...interface{})
Infof(string, ...interface{})
Warnf(string, ...interface{})
Errorf(string, ...interface{})
Fatalf(string, ...interface{})
Panicf(string, ...interface{})
}
type Option ¶
type Option struct {
Name string
Value interface{}
}
func MessageQueue ¶
func NoSignature ¶
func NoSignature() Option
func WorkerPool ¶
type Receiver ¶
type Receiver interface {
Receive(ActorContext, Message)
}
type ReceiverFunc ¶
type ReceiverFunc func(ActorContext, Message)
func (ReceiverFunc) Receive ¶
func (f ReceiverFunc) Receive(ctx ActorContext, msg Message)
type Ref ¶
type ServiceExecutor ¶
type ServiceExecutor interface {
ExecuteService(Receiver, string, ...Option) (ActorHandler, error)
}
type Settings ¶
type Settings interface {
Get(string) interface{}
GetBool(string) bool
GetFloat64(string) float64
GetInt(string) int
GetIntSlice(string) []int
GetString(string) string
GetStringSlice(string) []string
GetTime(string) time.Time
GetDuration(string) time.Duration
IsSet(string) bool
GetDefault(string, interface{}) interface{}
GetDefaultBool(string, bool) bool
GetDefaultFloat64(string, float64) float64
GetDefaultInt(string, int) int
GetDefaultIntSlice(string, ...int) []int
GetDefaultString(string, string) string
GetDefaultStringSlice(string, ...string) []string
GetDefaultTime(string, time.Time) time.Time
GetDefaultDuration(string, time.Duration) time.Duration
GetSub(string) Settings
}
type Startable ¶
type Startable interface {
PreStart(ActorContext) error
}
type Stopable ¶
type Stopable interface {
PostStop(ActorContext) error
}
type System ¶
type SystemSettings ¶
type SystemSettings interface {
Settings
NoSignature() bool
GetActorSettings(string, ...Option) ActorSettings
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.