strategy

package
v1.7.10 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRepository

func InitRepository(ctx context.Context)

func NewAuthenticateDataSource

func NewAuthenticateDataSource() auth.DataSource

func NewRedisPublicKeyStore

func NewRedisPublicKeyStore(ctx context.Context, opts ...RedisPublicKeyStoreOptions) auth.PublicKeyStore

Types

type Access

type Access struct {
	Model
	Name string
	Code string
}

type Model

type Model struct {
	ModelTime
	ID uint64 `gorm:"primaryKey" json:"id"`
}

type ModelTime added in v1.7.0

type ModelTime struct {
	CreatedAt time.Time `gorm:"autoUpdateTime" json:"-"`
	UpdatedAt time.Time `gorm:"autoCreateTime" json:"-"`
}

type RedisPublicKeyInfo

type RedisPublicKeyInfo struct {
	KeyId      string `json:"kid"`
	EncodedKey string `json:"key"`
}

type RedisPublicKeyStoreOptions

type RedisPublicKeyStoreOptions func(store *redisPublicKeyStore)

func WithChannel

func WithChannel(channel string) RedisPublicKeyStoreOptions

func WithKeyPrefix

func WithKeyPrefix(keyPrefix string) RedisPublicKeyStoreOptions

type Role

type Role struct {
	Model
	Name     string
	Accesses []Access `gorm:"many2many:role_access"`
}

type User

type User struct {
	gorm.Model
	UserAccount string `gorm:"column:account"`
	Password    string
	UserName    string `gorm:"column:name"`
	Roles       []Role `gorm:"many2many:user_role"`
}

func (*User) Accesses added in v1.7.0

func (u *User) Accesses() []auth.Access

func (*User) Account

func (u *User) Account() string

func (*User) Id

func (u *User) Id() interface{}

func (*User) Name

func (u *User) Name() string

func (*User) VerifyPassword

func (u *User) VerifyPassword(password string) bool

Jump to

Keyboard shortcuts

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