apikey

package
v0.0.0-...-1b0f315 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateApikey

func GenerateApikey() string

Types

type ApiKey

type ApiKey struct {
	Name      string    `json:"name,omitempty"`
	Key       string    `json:"key,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

type ApiKeyMap

type ApiKeyMap = map[string]ApiKey

type Storer

type Storer interface {
	GetByName(name string) (*ApiKey, error)
	GetByKey(key string) (*ApiKey, error)
	GetAll() (ApiKeyMap, error)
	Save(apikey ApiKey) error
	Delete(apikey string) error
}

Jump to

Keyboard shortcuts

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