Documentation ¶
Index ¶
- Variables
- func NewCasbinAdapter(cfg *Config) persist.Adapter
- func NewCasbinEnforcer(m model.Model, a persist.Adapter) (*casbin.Enforcer, error)
- func NewCasbinModel(cfg *Config) (model.Model, error)
- func NewEd25519PrivateKey(cfg *Config) (ed25519.PrivateKey, error)
- func NewEd25519PublicKey(cfg *Config) (ed25519.PublicKey, error)
- func NewRSAPrivateKey(cfg *Config) (*rsa.PrivateKey, error)
- func NewRSAPublicKey(cfg *Config) (*rsa.PublicKey, error)
- type Admin
- type Casbin
- type Config
- type Key
- type KeyPair
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewRSAPrivateKey), fx.Provide(NewRSAPublicKey), fx.Provide(NewEd25519PrivateKey), fx.Provide(NewEd25519PublicKey), fx.Provide(NewCasbinModel), fx.Provide(NewCasbinAdapter), fx.Provide(NewCasbinEnforcer), )
Module for fx.
Functions ¶
func NewCasbinAdapter ¶ added in v1.12.0
NewCasbinAdapter for config.
func NewCasbinEnforcer ¶ added in v1.12.0
NewCasbinEnforcer for config.
func NewCasbinModel ¶ added in v1.12.0
NewCasbinModel for config.
func NewEd25519PrivateKey ¶ added in v1.10.3
func NewEd25519PrivateKey(cfg *Config) (ed25519.PrivateKey, error)
NewEd25519PrivateKey from key.
func NewEd25519PublicKey ¶ added in v1.12.0
NewEd25519PublicKey from key.
func NewRSAPrivateKey ¶ added in v1.10.3
func NewRSAPrivateKey(cfg *Config) (*rsa.PrivateKey, error)
NewRSAPrivateKey from key.
Types ¶
type Casbin ¶ added in v1.12.0
type Casbin struct { Model string `yaml:"model" json:"model" toml:"model"` Policy string `yaml:"policy" json:"policy" toml:"policy"` }
Casbin for v1.
type Config ¶
type Config struct { Issuer string `yaml:"issuer" json:"issuer" toml:"issuer"` Casbin Casbin `yaml:"casbin" json:"casbin" toml:"casbin"` Key Key `yaml:"key" json:"key" toml:"key"` Admins []Admin `yaml:"admins" json:"admins" toml:"admins"` Services []Service `yaml:"services" json:"services" toml:"services"` }
Config for v1.
type Key ¶
type Key struct { RSA KeyPair `yaml:"rsa" json:"rsa" toml:"rsa"` Ed25519 KeyPair `yaml:"ed25519" json:"ed25519" toml:"ed25519"` }
Key for v1.
Click to show internal directories.
Click to hide internal directories.