daemon

package
v0.0.0-...-0a4ec91 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2019 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilenameForSessionID

func FilenameForSessionID(id int64, dir string) string

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB wraps storm.Node, changes some behaviors when error returned

func (*DB) All

func (d *DB) All(to interface{}, options ...func(*index.Options)) (err error)

func (*DB) CheckDuplicated

func (d *DB) CheckDuplicated(bucket string, keyName string, keyVal interface{}) (err error)

func (*DB) Close

func (d *DB) Close() error

func (*DB) Count

func (d *DB) Count(data interface{}) (c int, err error)

func (*DB) DeleteStruct

func (d *DB) DeleteStruct(data interface{}) (err error)

func (*DB) Find

func (d *DB) Find(fieldName string, val interface{}, out interface{}, options ...func(q *index.Options)) (err error)

func (*DB) One

func (d *DB) One(fieldName string, value interface{}, to interface{}) (err error)

func (*DB) Save

func (d *DB) Save(data interface{}) (err error)

func (*DB) Tx

func (d *DB) Tx(writable bool, cb func(*Node) error) (err error)

type Daemon

type Daemon struct {
	// contains filtered or unexported fields
}

Daemon daemon instance

func New

func New(opts types.DaemonOptions) *Daemon

func (*Daemon) AuthenticateUser

func (d *Daemon) AuthenticateUser(c context.Context, req *types.AuthenticateUserRequest) (res *types.AuthenticateUserResponse, err error)

func (*Daemon) CheckGrant

func (d *Daemon) CheckGrant(c context.Context, req *types.CheckGrantRequest) (res *types.CheckGrantResponse, err error)

func (*Daemon) CreateKey

func (d *Daemon) CreateKey(c context.Context, req *types.CreateKeyRequest) (res *types.CreateKeyResponse, err error)

func (*Daemon) CreateSession

func (d *Daemon) CreateSession(c context.Context, req *types.CreateSessionRequest) (res *types.CreateSessionResponse, err error)

func (*Daemon) CreateToken

func (d *Daemon) CreateToken(c context.Context, req *types.CreateTokenRequest) (res *types.CreateTokenResponse, err error)

func (*Daemon) CreateUser

func (d *Daemon) CreateUser(c context.Context, req *types.CreateUserRequest) (res *types.CreateUserResponse, err error)

func (*Daemon) DeleteGrant

func (d *Daemon) DeleteGrant(c context.Context, req *types.DeleteGrantRequest) (res *types.DeleteGrantResponse, err error)

func (*Daemon) DeleteKey

func (d *Daemon) DeleteKey(c context.Context, req *types.DeleteKeyRequest) (res *types.DeleteKeyResponse, err error)

func (*Daemon) DeleteNode

func (d *Daemon) DeleteNode(c context.Context, req *types.DeleteNodeRequest) (res *types.DeleteNodeResponse, err error)

func (*Daemon) DeleteToken

func (d *Daemon) DeleteToken(c context.Context, req *types.DeleteTokenRequest) (res *types.DeleteTokenResponse, err error)

func (*Daemon) FinishSession

func (d *Daemon) FinishSession(c context.Context, req *types.FinishSessionRequest) (res *types.FinishSessionResponse, err error)

func (*Daemon) GetKey

func (d *Daemon) GetKey(c context.Context, req *types.GetKeyRequest) (res *types.GetKeyResponse, err error)

func (*Daemon) GetNode

func (d *Daemon) GetNode(c context.Context, req *types.GetNodeRequest) (res *types.GetNodeResponse, err error)

func (*Daemon) GetSession

func (d *Daemon) GetSession(c context.Context, req *types.GetSessionRequest) (res *types.GetSessionResponse, err error)

func (*Daemon) GetToken

func (d *Daemon) GetToken(c context.Context, req *types.GetTokenRequest) (res *types.GetTokenResponse, err error)

func (*Daemon) GetUser

func (d *Daemon) GetUser(c context.Context, req *types.GetUserRequest) (res *types.GetUserResponse, err error)

func (*Daemon) ListGrantItems

func (d *Daemon) ListGrantItems(c context.Context, req *types.ListGrantItemsRequest) (res *types.ListGrantItemsResponse, err error)

func (*Daemon) ListGrants

func (d *Daemon) ListGrants(c context.Context, req *types.ListGrantsRequest) (res *types.ListGrantsResponse, err error)

func (*Daemon) ListKeys

func (d *Daemon) ListKeys(c context.Context, req *types.ListKeysRequest) (res *types.ListKeysResponse, err error)

func (*Daemon) ListMasterKeys

func (d *Daemon) ListMasterKeys(ctx context.Context, req *types.ListMasterKeysRequest) (res *types.ListMasterKeysResponse, err error)

func (*Daemon) ListNodes

func (d *Daemon) ListNodes(c context.Context, req *types.ListNodesRequest) (res *types.ListNodesResponse, err error)

func (*Daemon) ListSessions

func (d *Daemon) ListSessions(c context.Context, req *types.ListSessionsRequest) (res *types.ListSessionsResponse, err error)

func (*Daemon) ListTokens

func (d *Daemon) ListTokens(c context.Context, req *types.ListTokensRequest) (res *types.ListTokensResponse, err error)

func (*Daemon) ListUsers

func (d *Daemon) ListUsers(c context.Context, req *types.ListUsersRequest) (res *types.ListUsersResponse, err error)

func (*Daemon) PutGrant

func (d *Daemon) PutGrant(c context.Context, req *types.PutGrantRequest) (res *types.PutGrantResponse, err error)

func (*Daemon) PutNode

func (d *Daemon) PutNode(c context.Context, req *types.PutNodeRequest) (res *types.PutNodeResponse, err error)

func (*Daemon) ReadReplay

func (*Daemon) Run

func (d *Daemon) Run() (err error)

func (*Daemon) SearchReplay

func (d *Daemon) SearchReplay(ctx context.Context, req *types.SearchReplayRequest) (resp *types.SearchReplayResponse, err error)

func (*Daemon) Stop

func (d *Daemon) Stop()

func (*Daemon) SubmitReplay

func (d *Daemon) SubmitReplay(ctx context.Context, req *types.SubmitReplayRequest) (resp *types.SubmitReplayResponse, err error)

func (*Daemon) TouchKey

func (d *Daemon) TouchKey(c context.Context, req *types.TouchKeyRequest) (res *types.TouchKeyResponse, err error)

func (*Daemon) TouchNode

func (d *Daemon) TouchNode(c context.Context, req *types.TouchNodeRequest) (res *types.TouchNodeResponse, err error)

func (*Daemon) TouchToken

func (d *Daemon) TouchToken(c context.Context, req *types.TouchTokenRequest) (res *types.TouchTokenResponse, err error)

func (*Daemon) TouchUser

func (d *Daemon) TouchUser(c context.Context, req *types.TouchUserRequest) (res *types.TouchUserResponse, err error)

func (*Daemon) UpdateAllMasterKeys

func (d *Daemon) UpdateAllMasterKeys(ctx context.Context, req *types.UpdateAllMasterKeysRequest) (res *types.UpdateAllMasterKeysResponse, err error)

func (*Daemon) UpdateNode

func (d *Daemon) UpdateNode(c context.Context, req *types.UpdateNodeRequest) (res *types.UpdateNodeResponse, err error)

func (*Daemon) UpdateUser

func (d *Daemon) UpdateUser(c context.Context, req *types.UpdateUserRequest) (res *types.UpdateUserResponse, err error)

func (*Daemon) WriteReplay

func (d *Daemon) WriteReplay(s types.ReplayService_WriteReplayServer) (err error)

type Node

type Node struct {
	// contains filtered or unexported fields
}

func (*Node) All

func (d *Node) All(to interface{}, options ...func(*index.Options)) (err error)

func (*Node) CheckDuplicated

func (d *Node) CheckDuplicated(bucket string, keyName string, keyVal interface{}) (err error)

func (*Node) Count

func (d *Node) Count(data interface{}) (c int, err error)

func (*Node) DeleteStruct

func (d *Node) DeleteStruct(data interface{}) (err error)

func (*Node) Find

func (d *Node) Find(fieldName string, val interface{}, out interface{}, options ...func(q *index.Options)) (err error)

func (*Node) One

func (d *Node) One(fieldName string, value interface{}, to interface{}) (err error)

func (*Node) Save

func (d *Node) Save(data interface{}) (err error)

func (*Node) Select

func (d *Node) Select(matchers ...q.Matcher) *Query

type Query

type Query struct {
	// contains filtered or unexported fields
}

func (*Query) Count

func (q *Query) Count(data interface{}) (i int, err error)

func (*Query) Delete

func (q *Query) Delete(data interface{}) (err error)

type ReplayIndice

type ReplayIndice struct {
	SessionId int64     `json:"session_id"`
	Timestamp uint32    `json:"timestamp"`
	Content   string    `json:"content"`
	Account   string    `json:"account"`
	CreatedAt time.Time `json:"created_at"`
}

type ReplaySubmitter

type ReplaySubmitter struct {
	Account   string
	SessionId int64
	CreatedAt time.Time
	Index     string
	EsClient  *elastic.Client
	// contains filtered or unexported fields
}

func NewReplaySubmitter

func NewReplaySubmitter(createdAt time.Time, sessionId int64, account string, esClient *elastic.Client) (r *ReplaySubmitter)

func (*ReplaySubmitter) Add

func (r *ReplaySubmitter) Add(f types.ReplayFrame) (err error)

func (*ReplaySubmitter) Close

func (r *ReplaySubmitter) Close() (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL