config

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Module for fx.

Functions

func NewCasbinAdapter added in v1.12.0

func NewCasbinAdapter(cfg *Config) persist.Adapter

NewCasbinAdapter for config.

func NewCasbinEnforcer added in v1.12.0

func NewCasbinEnforcer(m model.Model, a persist.Adapter) (*casbin.Enforcer, error)

NewCasbinEnforcer for config.

func NewCasbinModel added in v1.12.0

func NewCasbinModel(cfg *Config) (model.Model, error)

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

func NewEd25519PublicKey(cfg *Config) (ed25519.PublicKey, error)

NewEd25519PublicKey from key.

func NewRSAPrivateKey added in v1.10.3

func NewRSAPrivateKey(cfg *Config) (*rsa.PrivateKey, error)

NewRSAPrivateKey from key.

func NewRSAPublicKey added in v1.10.3

func NewRSAPublicKey(cfg *Config) (*rsa.PublicKey, error)

NewRSAPublicKey from key.

Types

type Admin

type Admin struct {
	ID   string `yaml:"id"`
	Hash string `yaml:"hash"`
}

Admin for v1.

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.

func (*Key) Pair added in v1.10.0

func (k *Key) Pair(kind string) *KeyPair

Pair from kind.

type KeyPair added in v1.9.0

type KeyPair struct {
	Public  string `yaml:"public"`
	Private string `yaml:"private"`
}

RSA for v1.

type Service added in v1.7.0

type Service struct {
	ID       string        `yaml:"id"`
	Hash     string        `yaml:"hash"`
	Duration time.Duration `yaml:"duration"`
}

Service for v1.

Jump to

Keyboard shortcuts

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