Versions in this module Expand all Collapse all v1 v1.5.0 Jun 29, 2024 v1.4.0 Aug 9, 2022 Changes in this version + func RegisterAuthManagerInitFn(pluginID string, fn func(InitArgs) (AuthManager, error)) + func RegisterPluginInitFn(pluginID string, fn func(InitArgs) (Plugin, error)) + func RegisterUserManagerInitFn(pluginID string, fn func(InitArgs) (UserManager, error)) + type AuthManager interface + Authorize func(AuthorizeArgs) error + ID func() string + Version func() uint32 + func NewAuthManager(pluginID string, args InitArgs) (AuthManager, error) + type AuthorizeArgs struct + Cmd string + PluginID string + Session *Session + User *User + Version uint32 + type Cmd struct + Cmd string + Payload string + PluginID string + Version uint32 + type HookArgs struct + Cmd Cmd + Reply *Reply + Type HookT + User *User + type HookT string + const HookInvalid + const HookPostNewUser + const HookPostWrite + const HookPreNewUser + const HookPreWrite + type InitArgs struct + Settings []Setting + type Plugin interface + Hook func(HookArgs) error + HookTx func(*sql.Tx, HookArgs) error + ID func() string + Permissions func() map[string]string + Read func(ReadArgs) (*Reply, error) + ReadTx func(*sql.Tx, ReadArgs) (*Reply, error) + SetPermission func(cmd, permissionLevel string) + Version func() uint32 + WriteTx func(*sql.Tx, WriteArgs) (*Reply, error) + func NewPlugin(pluginID string, args InitArgs) (Plugin, error) + type PluginData struct + func NewPluginData(clearText, encrypted []byte) *PluginData + func (d *PluginData) ClearText() []byte + func (d *PluginData) Encrypted() []byte + func (d *PluginData) SetClearText(b []byte) + func (d *PluginData) SetEncrypted(b []byte) + func (d *PluginData) Updated() bool + type ReadArgs struct + Cmd Cmd + User *User + type Reply struct + Error error + Payload string + type Session struct + CreatedAt int64 + Delete bool + UserID string + type Setting struct + Key string + Value string + type User struct + ID uuid.UUID + PluginData *PluginData + type UserError struct + ErrorCode uint32 + ErrorContext string + PluginID string + func (e UserError) Error() string + type UserManager interface + ID func() string + NewUser func(*sql.Tx, WriteArgs) (*Reply, error) + Version func() uint32 + func NewUserManager(pluginID string, args InitArgs) (UserManager, error) + type WriteArgs struct + Cmd Cmd + User *User