loader

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExtensionIsEmpty    = errors.New("extension is empty")
	ErrStorageNotSpecified = errors.New("storage not specified")
)

Functions

This section is empty.

Types

type KeyIDType

type KeyIDType uint32
const (
	// FileNameWithoutExtension - Key ID Type for which the key id is formated based on the file name, excluding the extension.
	//
	//	FilePath: /tmp/xxx/.../ss/key.pem
	//  KeyID -> key
	//
	FileNameWithoutExtension KeyIDType = 1 << iota

	// FileNameWithExtension - Key ID Type for which the key id is formated based on the file name, including the extension.
	//
	//	FilePath: /tmp/xxx/.../ss/key.pem
	//  KeyID -> key.pem
	//
	FileNameWithExtension

	// FileFullPathRelativeToLocation - Key ID Type for which the key id will be the subpath by excluding the given location.
	//
	//	FilePath: /tmp/xxx/ss/key.pem
	//  Given Location: /tmp/xxx
	//  KeyID -> /ss/key.pem
	//
	FileFullPathRelativeToLocation

	// FileFullPath - Key ID Type for which the key id will be the full path.
	//
	//	FilePath: /tmp/xxx/ss/key.pem
	//  KeyID -> /tmp/xxx/ss/key.pem
	//
	FileFullPath
)

type Loader

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

func Create

func Create(location string, opts ...Option) (*Loader, error)

func (*Loader) StartWatching

func (dl *Loader) StartWatching() error

StartWatching starts a watcher on the given directory.

func (*Loader) StopWatching

func (dl *Loader) StopWatching() error

StopWatching stop a watcher on the given directory.

func (*Loader) Storage

func (dl *Loader) Storage() keyvalue.ReadStorage[string, []byte]

type Option

type Option func(*Loader) error

func WithExtension

func WithExtension(value string) Option

func WithKeyIDType

func WithKeyIDType(value KeyIDType) Option

func WithStorage

func WithStorage(storage keyvalue.Storage[string, []byte]) Option

Jump to

Keyboard shortcuts

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