local

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyNameSeparator = errors.New("name separator cannot be empty")
)

Functions

This section is empty.

Types

type BasicService added in v0.1.2

type BasicService interface {
	goapikey.BasicService
	Load(path string) error
}

BasicService is the basic service interface for API key validation

type Service

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

Service is the local service for API key validation

func NewService

func NewService(nameSeparator string, logger *slog.Logger) (*Service, error)

NewService creates a new local service for API key validation

Parameters:

  • logger: the logger to use

Returns:

  • *Service: the local service
  • error: An error if something went wrong

func (Service) IsAPIKeyValid

func (s Service) IsAPIKeyValid(apiKey string) bool

IsAPIKeyValid checks if the API key is valid

Parameters:

  • apiKey: the API key to check

Returns:

- bool: true if the API key is valid, false otherwise

func (Service) Load

func (s Service) Load(path string) error

Load loads the API keys from the file

Parameters:

  • path: the path to the file
  • logger: the logger to use

Returns:

  • error: An error if something went wrong

Jump to

Keyboard shortcuts

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