apikey

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrApiKeyNotFound = errors.New("api key not found")
)

Functions

func IsApiKeyNotFound added in v0.18.0

func IsApiKeyNotFound(err error) bool

Types

type ApiKey

type ApiKey struct {
	KeyHash string     `json:"keyHash" validate:"required"`
	Type    ApiKeyType `json:"type" validate:"required"`
	// Project or client name
	Name string `json:"name" validate:"required"`

} // @name ApiKey

type ApiKeyType

type ApiKeyType string
const (
	ApiKeyTypeClient    ApiKeyType = "client"
	ApiKeyTypeProject   ApiKeyType = "project"
	ApiKeyTypeWorkspace ApiKeyType = "workspace"
)

type Store

type Store interface {
	List() ([]*ApiKey, error)
	Find(key string) (*ApiKey, error)
	FindByName(name string) (*ApiKey, error)
	Save(apiKey *ApiKey) error
	Delete(apiKey *ApiKey) error
}

Jump to

Keyboard shortcuts

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