Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateClientID ¶
CreateClientID creates a client ID for client instance.
func FormatClientLog ¶
FormatClientLog format client log record.
Types ¶
type Client ¶
type Client interface { Close() GetConnID() string GetConn() Conn GetUser() rprt.User IsAllowed(member rprt.Member) bool LogError(format string, args ...interface{}) LogWarn(format string, args ...interface{}) LogInfo(format string, args ...interface{}) LogDebug(format string, args ...interface{}) Auth(Request) (interface{}, error) GetMethods(Request) (interface{}, error) GetUsers(Request) (interface{}, error) SubscribeToLog(Request) (interface{}, error) UnsubscribeFromLog(Request) (interface{}, error) AddReport(Request) (interface{}, error) GetReportList(Request) (interface{}, error) SubscribeToReports(Request) (interface{}, error) UnsubscribeFromReports(Request) (interface{}, error) Test(Request) (interface{}, error) }
Client is an access point connected client.
type Clients ¶
type Clients interface { // Close closes the database. Close() // Get returns client by kite.Client. Get(*kite.Client) (Client, error) // Add adds new connetion in the database. Add(Client) // Remove removes a connetion from the database. Remove(*kite.Client) // RegisterMethod informs the client object about new method for users. RegisterMethod(rprt.UserMethod) // GetMethod returns a method list witch available. GetMethods() []rprt.UserMethod }
Clients is a connected clients database.
func CreateClients ¶
CreateClients creates a new Clients instance.
type Conn ¶
type Conn interface { Close() GetHandle() *kite.Client CallRemoteWithTimeout( method string, timeout time.Duration, args ...interface{}) ( *dnode.Partial, error) }
Conn wraps Kite client object.
type GroupMessage ¶
GroupMessage describes message format for group record.
func CreateGroupMessage ¶
func CreateGroupMessage(group rprt.Group) GroupMessage
CreateGroupMessage creates GroupMessage object from rprt.Group.
type LogRecordMessage ¶
type LogRecordMessage struct { SequenceNumber int64 `json:"seqNum"` Time int64 `json:"time"` Text string `json:"text"` Severity string `json:"severity"` NodeType string `json:"nodeType"` NodeName string `json:"nodeName"` }
LogRecordMessage describes message format for log record.
func CreateLogRecordMessage ¶
func CreateLogRecordMessage(record rprt.LogRecord) LogRecordMessage
CreateLogRecordMessage creates LogRecordMessage object from rprt.LogRecord.
type ReportMessage ¶
type ReportMessage struct { ID rprt.ReportID `json:"id"` Title string `json:"title"` Desc string `json:"desc"` Author string `json:"author"` Membership GroupMessage `json:"membership"` }
ReportMessage describes message format for report record.
func CreateReportMessage ¶
func CreateReportMessage(report rprt.Report) ReportMessage
CreateReportMessage creates ReportMessage object from rprt.Report.
type Request ¶
type Request interface {
GetArgs() RequestArgs
}
Request wraps kite.Request.
func CreateRequest ¶
CreateRequest creates an instance of Request
type RequestArgs ¶
RequestArgs wraps dnode.Partial