Documentation ¶
Index ¶
- func ClientWithDatabaseRead(db db.Manager) common.Option[clientManager]
- func ClientWithExecuteMigration(enabled bool, dir ...string) common.Option[clientManager]
- func ClientWithLazyLoadData(v bool) common.Option[clientManager]
- func ClientWithLogger(v logger.Manager) common.Option[clientManager]
- func UserAuthWithDatabaseRead(db db.Manager) common.Option[clientManager]
- func UserAuthWithLogger(v logger.Manager) common.Option[clientManager]
- type Client
- type ClientManager
- type ClientScope
- type ClientScopes
- type ClientWithScopes
- type Clients
- type ClientsWithScopes
- type Scope
- type Scopes
- func (s Scopes) AllowedTo(scope Scope) bool
- func (s Scopes) AllowedToRead() bool
- func (s Scopes) AllowedToWrite() bool
- func (s Scopes) FromStringArray(values []string) Scopes
- func (s Scopes) IsAllowedByHttpMethod(method string) bool
- func (s *Scopes) Scan(src interface{}) error
- func (s Scopes) ToStringArray() []string
- func (s Scopes) Value() (driver.Value, error)
- type UserAuthRecord
- type UserAuthRecords
- type UserManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientWithDatabaseRead ¶ added in v0.3.0
func ClientWithExecuteMigration ¶ added in v0.3.0
func ClientWithLazyLoadData ¶ added in v0.3.0
func ClientWithLogger ¶ added in v0.3.0
func UserAuthWithDatabaseRead ¶ added in v0.3.6
Types ¶
type ClientManager ¶ added in v0.3.0
type ClientManager interface { AddClients(ctx context.Context, items Clients) error AddScopes(ctx context.Context, items ClientScopes) error AddClientsWithScopes(ctx context.Context, items ClientWithScopes) error GetClientsWithScopesBy(ctx context.Context, by db.IHelper) (ClientsWithScopes, error) VoidClientsByIds(ctx context.Context, ids ...int) error VoidScopeByIds(ctx context.Context, id ...int) error IsAllowed(secret, resource, scope string) (clientName string, allowed bool) Init() error MustInit() ClientManager AddOptions(opts ...common.Option[clientManager]) ClientManager // contains filtered or unexported methods }
func NewClientManager ¶ added in v0.3.0
func NewClientManager(dbm db.Manager, opts ...common.Option[clientManager]) ClientManager
type ClientScope ¶ added in v0.3.0
type ClientScopes ¶ added in v0.3.0
type ClientScopes []*ClientScope
type ClientWithScopes ¶ added in v0.3.0
type ClientWithScopes struct { *Client Scopes ClientScopes }
type ClientsWithScopes ¶ added in v0.3.0
type ClientsWithScopes []*ClientWithScopes
type Scope ¶ added in v0.3.0
type Scope string
func (Scope) FromHttpMethod ¶ added in v0.3.2
type Scopes ¶ added in v0.3.0
type Scopes []Scope
func (Scopes) AllowedToRead ¶ added in v0.3.0
func (Scopes) AllowedToWrite ¶ added in v0.3.0
func (Scopes) FromStringArray ¶ added in v0.3.0
func (Scopes) IsAllowedByHttpMethod ¶ added in v0.3.0
func (Scopes) ToStringArray ¶ added in v0.3.0
type UserAuthRecord ¶ added in v0.3.6
type UserAuthRecord struct { ID int `db:"id"` UserID int `db:"user_id"` Email string `db:"email"` Phone string `db:"phone"` Creds string `db:"creds"` Disabled bool `db:"disabled"` CreatedAt time.Time `db:"created_at"` UpdatedAt *time.Time `db:"updated_at"` DisabledAt *time.Time `db:"disabled_at"` ExpiredAt *time.Time `db:"expired_at"` }
type UserAuthRecords ¶ added in v0.3.6
type UserAuthRecords []*UserAuthRecord
type UserManager ¶ added in v0.3.6
type UserManager interface { Add(ctx context.Context, records ...UserAuthRecord) error Save(ctx context.Context, record UserAuthRecord) (UserAuthRecord, error) RemoveByIds(ctx context.Context, ids ...int) error RemoveByUserIds(ctx context.Context, userIds ...int) error GetByUserIds(ctx context.Context, userIds ...int) (UserAuthRecords, error) Init() error MustInit() UserManager }
func NewUserAuthManager ¶ added in v0.3.6
func NewUserAuthManager(dbm db.Manager, opts ...common.Option[userManager]) UserManager
Click to show internal directories.
Click to hide internal directories.