Documentation ¶
Index ¶
- Constants
- func Assert(value bool)
- func ErrorExit(stream *os.File, err error)
- func ErrorWrite(stream *os.File, err error)
- func FatalErrorNew() error
- func InfoKeyValueNew(pairs map[string][]string, extra ...interface{}) ([]byte, error)
- func InfoKeyValueParse(info []byte) map[string][]string
- func StackErrorWrapNew(value interface{}) error
- func ThreadCount() (uint32, error)
- type AssertionError
- type Callback
- type FatalError
- type ForwardAsyncError
- type ForwardSyncError
- type Instance
- func (api *Instance) Forward(requestType int, name string, requestInfo, request []byte, timeout uint32, ...)
- func (api *Instance) ForwardAsync(name string, requestInfo, request []byte, timeout uint32, priority int8, ...)
- func (api *Instance) ForwardSync(name string, requestInfo, request []byte, timeout uint32, priority int8, ...)
- func (api *Instance) McastAsync(name string, requestInfo, request []byte, timeoutPriority ...interface{}) ([][]byte, error)
- func (api *Instance) Poll(timeout int32) (bool, error)
- func (api *Instance) Prefix() string
- func (api *Instance) ProcessCount() uint32
- func (api *Instance) ProcessCountMax() uint32
- func (api *Instance) ProcessCountMin() uint32
- func (api *Instance) ProcessIndex() uint32
- func (api *Instance) RecvAsync(extra ...interface{}) ([]byte, []byte, []byte, error)
- func (api *Instance) Return(requestType int, name, pattern string, responseInfo, response []byte, ...)
- func (api *Instance) ReturnAsync(name, pattern string, responseInfo, response []byte, timeout uint32, ...)
- func (api *Instance) ReturnSync(name, pattern string, responseInfo, response []byte, timeout uint32, ...)
- func (api *Instance) SendAsync(name string, requestInfo, request []byte, timeoutPriority ...interface{}) ([]byte, error)
- func (api *Instance) SendSync(name string, requestInfo, request []byte, timeoutPriority ...interface{}) ([]byte, []byte, []byte, error)
- func (api *Instance) Shutdown(extra ...interface{}) error
- func (api *Instance) Subscribe(pattern string, function Callback) error
- func (api *Instance) SubscribeCount(pattern string) (uint32, error)
- func (api *Instance) TimeoutAsync() uint32
- func (api *Instance) TimeoutInitialize() uint32
- func (api *Instance) TimeoutSync() uint32
- func (api *Instance) TimeoutTerminate() uint32
- func (api *Instance) Unsubscribe(pattern string) error
- type InvalidInputError
- type MessageDecodingError
- type ReturnAsyncError
- type ReturnSyncError
- type Source
- type StackError
- type StackErrorWrap
- type TerminateError
Constants ¶
const ( // ASYNC is the requestType provided when handling an asynchronous service request ASYNC = 1 // SYNC is the requestType provided when handling a synchronous service request SYNC = -1 )
Variables ¶
This section is empty.
Functions ¶
func ErrorWrite ¶
ErrorWrite outputs error information to the cloudi.log file through stderr
func InfoKeyValueNew ¶
InfoKeyValueNew encodes service response info key/value data
func InfoKeyValueParse ¶
InfoKeyValueParse decodes service request info key/value data
func StackErrorWrapNew ¶
func StackErrorWrapNew(value interface{}) error
StackErrorWrapNew creates a new error with a stack trace from any data
func ThreadCount ¶
ThreadCount returns the thread count from the service configuration
Types ¶
type AssertionError ¶
type AssertionError struct {
// contains filtered or unexported fields
}
AssertionError indicates an unrecoverable condition in a CloudI service
func (*AssertionError) Error ¶
func (e *AssertionError) Error() string
func (*AssertionError) Stack ¶
func (e *AssertionError) Stack() []byte
Stack return the stack stored when the error was created
type Callback ¶
type Callback func(int, string, string, []byte, []byte, uint32, int8, [16]byte, Source, interface{}, *Instance) ([]byte, []byte, error)
Callback is a function to handle a service request
type FatalError ¶
type FatalError struct {
// contains filtered or unexported fields
}
FatalError indicates an unrecoverable error in a CloudI service
func (*FatalError) Error ¶
func (e *FatalError) Error() string
func (*FatalError) Stack ¶
func (e *FatalError) Stack() []byte
Stack return the stack stored when the error was created
type ForwardAsyncError ¶
type ForwardAsyncError struct { }
ForwardAsyncError indicates a request was handled with an async forward
func (*ForwardAsyncError) Error ¶
func (e *ForwardAsyncError) Error() string
type ForwardSyncError ¶
type ForwardSyncError struct { }
ForwardSyncError indicates a request was handled with a sync forward
func (*ForwardSyncError) Error ¶
func (e *ForwardSyncError) Error() string
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance is an instance of the CloudI API
func (*Instance) Forward ¶
func (api *Instance) Forward(requestType int, name string, requestInfo, request []byte, timeout uint32, priority int8, transId [16]byte, pid Source)
Forward forwards a service request to a different service name
func (*Instance) ForwardAsync ¶
func (api *Instance) ForwardAsync(name string, requestInfo, request []byte, timeout uint32, priority int8, transId [16]byte, pid Source)
ForwardAsync forwards an asynchronous service request to a different service name
func (*Instance) ForwardSync ¶
func (api *Instance) ForwardSync(name string, requestInfo, request []byte, timeout uint32, priority int8, transId [16]byte, pid Source)
ForwardSync forwards a synchronous service request to a different service name
func (*Instance) McastAsync ¶
func (api *Instance) McastAsync(name string, requestInfo, request []byte, timeoutPriority ...interface{}) ([][]byte, error)
McastAsync sends asynchronous service requests to all subscribers of the matching service name pattern
func (*Instance) Prefix ¶
Prefix returns the service name pattern prefix from the service configuration
func (*Instance) ProcessCount ¶
ProcessCount returns the current process count based on the service configuration
func (*Instance) ProcessCountMax ¶
ProcessCountMax returns the count_process_dynamic maximum count based on the service configuration
func (*Instance) ProcessCountMin ¶
ProcessCountMin returns the count_process_dynamic minimum count based on the service configuration
func (*Instance) ProcessIndex ¶
ProcessIndex returns the 0-based index of this process in the service instance
func (*Instance) Return ¶
func (api *Instance) Return(requestType int, name, pattern string, responseInfo, response []byte, timeout uint32, transId [16]byte, pid Source)
Return provides a response to a service request
func (*Instance) ReturnAsync ¶
func (api *Instance) ReturnAsync(name, pattern string, responseInfo, response []byte, timeout uint32, transId [16]byte, pid Source)
ReturnAsync provides a response to an asynchronous service request
func (*Instance) ReturnSync ¶
func (api *Instance) ReturnSync(name, pattern string, responseInfo, response []byte, timeout uint32, transId [16]byte, pid Source)
ReturnSync provides a response to a synchronous service request
func (*Instance) SendAsync ¶
func (api *Instance) SendAsync(name string, requestInfo, request []byte, timeoutPriority ...interface{}) ([]byte, error)
SendAsync sends an asynchronous service request
func (*Instance) SendSync ¶
func (api *Instance) SendSync(name string, requestInfo, request []byte, timeoutPriority ...interface{}) ([]byte, []byte, []byte, error)
SendSync sends a synchronous service request
func (*Instance) SubscribeCount ¶
SubscribeCount returns the number of subscriptions for a single service name pattern
func (*Instance) TimeoutAsync ¶
TimeoutAsync returns the default asynchronous service request send timeout from the service configuration
func (*Instance) TimeoutInitialize ¶
TimeoutInitialize returns the service initialization timeout from the service configuration
func (*Instance) TimeoutSync ¶
TimeoutSync returns the default synchronous service request send timeout from the service configuration
func (*Instance) TimeoutTerminate ¶
TimeoutTerminate returns the service termination timeout based on the service configuration
func (*Instance) Unsubscribe ¶
Unsubscribe unsubscribes from a service name pattern once
type InvalidInputError ¶
type InvalidInputError struct {
// contains filtered or unexported fields
}
InvalidInputError indicates that invalid input was provided
func (*InvalidInputError) Error ¶
func (e *InvalidInputError) Error() string
func (*InvalidInputError) Stack ¶
func (e *InvalidInputError) Stack() []byte
Stack return the stack stored when the error was created
type MessageDecodingError ¶
type MessageDecodingError struct {
// contains filtered or unexported fields
}
MessageDecodingError indicates an error decoding CloudI messages
func (*MessageDecodingError) Error ¶
func (e *MessageDecodingError) Error() string
func (*MessageDecodingError) Stack ¶
func (e *MessageDecodingError) Stack() []byte
Stack return the stack stored when the error was created
type ReturnAsyncError ¶
type ReturnAsyncError struct { }
ReturnAsyncError indicates a request was handled with an async return
func (*ReturnAsyncError) Error ¶
func (e *ReturnAsyncError) Error() string
type ReturnSyncError ¶
type ReturnSyncError struct { }
ReturnSyncError indicates a request was handled with a sync return
func (*ReturnSyncError) Error ¶
func (e *ReturnSyncError) Error() string
type Source ¶
type Source erlang.OtpErlangPid
Source is the Erlang pid that is the source of the service request
type StackError ¶
type StackError interface {
Stack() []byte
}
StackError provides an interface for error structs that provide a stacktrace
type StackErrorWrap ¶
type StackErrorWrap struct { Value error // contains filtered or unexported fields }
StackErrorWrap is used to attach a stacktrace to panic data as an error
func (*StackErrorWrap) Error ¶
func (e *StackErrorWrap) Error() string
func (*StackErrorWrap) Stack ¶
func (e *StackErrorWrap) Stack() []byte
Stack return the stack stored when the error was created
type TerminateError ¶
type TerminateError struct {
// contains filtered or unexported fields
}
TerminateError indicates that unavoidable termination is occurring
func (*TerminateError) Error ¶
func (e *TerminateError) Error() string
func (*TerminateError) Timeout ¶
func (e *TerminateError) Timeout() uint32
Timeout provides the termination timeout configured for the service