config

package
v0.0.0-...-9c23dc6 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Credentials map[string]*Credentials `yaml:"credentials"`
	Domains     map[string]*Domain      `yaml:"domains"`
	TTL         int                     `yaml:"ttl"`
	Users       []*User                 `yaml:"users"`
}

func Load

func Load(data []byte) (*Config, error)

func Read

func Read(filename string) (*Config, error)

func (*Config) AuthenticateUser

func (c *Config) AuthenticateUser(username string, password string) (*User, bool)

func (*Config) AuthorizeUser

func (c *Config) AuthorizeUser(user *User, domain *Domain) bool

func (*Config) FindUser

func (c *Config) FindUser(username string) (*User, bool)

type Credentials

type Credentials struct {
	AccessID  string `yaml:"access_id"`
	AccessKey string `yaml:"access_key"`
	Name      string
}

type Domain

type Domain struct {
	Credentials string `yaml:"credentials"`
	Name        string
	Users       []string `yaml:"users"`
	ZoneID      string   `yaml:"zone_id"`
}

type User

type User struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

Jump to

Keyboard shortcuts

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