schema

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = "v1"
	KeyName = "key"
	ReqName = "req"
	KeyPath = "/" + Version + "/" + KeyName
	ReqPath = "/" + Version + "/" + ReqName
)
View Source
const (
	MinKeySize = 1
	MaxKeySize = 1024
)

Variables

View Source
var (
	ErrEmptyKeyName        = errors.New("empty key name")
	ErrExistingKeyType     = errors.New("invalid key type for existing key")
	ErrExistingKeyEncoding = errors.New("invalid key encoding for existing key")
	ErrInvalidKeyName      = errors.New("invalid key name")
	ErrInvalidKeySize      = errors.New("invalid key size")
)

Functions

func ApproveURL

func ApproveURL(id, aid string) string

Types

type Approval

type Approval struct {
	ID     string       `json:"id"`
	AID    string       `json:"aid"`
	Name   string       `json:"name"`
	IP     string       `json:"ip"`
	Status types.Status `json:"status"`
}

type Approvals

type Approvals []Approval

func NewApprovals

func NewApprovals(m types.ApprovalMap) (a Approvals)

func (Approvals) Fields

func (a Approvals) Fields() string

func (Approvals) Len

func (a Approvals) Len() int

func (Approvals) Less

func (Approvals) Less(a, b Approval) int

func (Approvals) Sort

func (a Approvals) Sort()

func (Approvals) Values

func (a Approvals) Values() []string

type Key

type Key struct {
	ID       string        `json:"id"`
	Name     string        `json:"name"`
	Size     int           `json:"size"`
	Encoding core.Encoding `json:"encoding"`
	Type     core.Type     `json:"type"`
	Key      string        `json:"key,omitempty"`
}

func (Key) Print

func (k Key) Print(share string) (string, error)

type Keys

type Keys []Key

func NewKeys

func NewKeys(keys core.Keys) (k Keys)

func (Keys) Fields

func (k Keys) Fields() string

func (Keys) Len

func (k Keys) Len() int

func (Keys) Less

func (Keys) Less(a, b Key) int

func (Keys) Sort

func (k Keys) Sort()

func (Keys) Values

func (k Keys) Values() []string

type NewKey

type NewKey struct {
	Name     string        `json:"name"`
	Existing string        `json:"existing,omitempty"`
	Size     int           `json:"size"`
	Encoding core.Encoding `json:"encoding"`
	Type     core.Type     `json:"type"`
}

func (NewKey) Validate

func (nk NewKey) Validate() error

Jump to

Keyboard shortcuts

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