config

package
v1.13.3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Module for fx.

Functions

func NewBranca added in v1.10.3

func NewBranca(cfg *Config) (*branca.Branca, error)

NewBranca for config.

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"`
	Policy string `yaml:"policy"`
}

Casbin for v1.

type Config

type Config struct {
	Issuer   string    `yaml:"issuer"`
	Casbin   Casbin    `yaml:"casbin"`
	Key      Key       `yaml:"key"`
	Secret   Secret    `yaml:"secret"`
	Admins   []Admin   `yaml:"admins"`
	Services []Service `yaml:"services"`
}

Config for v1.

type Key

type Key struct {
	RSA     KeyPair `yaml:"rsa"`
	Ed25519 KeyPair `yaml:"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 Secret added in v1.8.0

type Secret struct {
	Branca string `yaml:"branca"`
}

Secret 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