keystore

package
v0.0.0-...-a213419 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyInfo

type KeyInfo struct {
	Key         string    `json:"key"`
	Description string    `json:"description"`
	CreatedAt   time.Time `json:"created_at"`
}

KeyInfo stores metadata about an API key

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store manages API keys on the server side

func NewStore

func NewStore(filePath string) (*Store, error)

NewStore creates a new key store

func (*Store) Add

func (s *Store) Add(key, description string) error

Add adds a new API key to the store

func (*Store) Clear

func (s *Store) Clear() error

Clear removes all keys

func (*Store) IsEmpty

func (s *Store) IsEmpty() bool

IsEmpty returns true if no keys are stored

func (*Store) List

func (s *Store) List() []*KeyInfo

List returns all stored keys

func (*Store) Remove

func (s *Store) Remove(key string) error

Remove removes an API key from the store

func (*Store) Validate

func (s *Store) Validate(key string) bool

Validate checks if an API key is valid using constant-time comparison

Jump to

Keyboard shortcuts

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