app

package
v0.0.0-...-bf2c6c7 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Db *model.Client

	Engine *gin.Engine
)

Functions

func AddAdminPolicy

func AddAdminPolicy(resource permission.Resource, action *permission.Action) (bool, error)

func Close

func Close()

func Init

func Init(ctx context.Context)

func InitPermission

func InitPermission(ctx context.Context, engine *gin.Engine)

func RemoveAdminPolicy

func RemoveAdminPolicy(resource permission.Resource, action *permission.Action) (bool, error)

func User

func User(ctx context.Context) string

func WithTx

func WithTx(ctx context.Context, fn func(tx *model.Tx) error) error

Types

type ConfigOption

type ConfigOption struct {
	DB         DBConfig         `yaml:"db"`
	Permission PermissionConfig `yaml:"permission"`
}
var Config *ConfigOption

type DBConfig

type DBConfig struct {
	Type   string `yaml:"type"`
	Source string `yaml:"source"`
}

type PermissionConfig

type PermissionConfig struct {
	Admin    string `yaml:"admin"`
	Password string `yaml:"password"`
	Role     string `yaml:"role"`
}

Jump to

Keyboard shortcuts

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