manager

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encrypter

type Encrypter interface {
	Encrypt(secret string) string
}

type Manager

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

func NewManager

func NewManager(s Storage, e Encrypter) *Manager

func (*Manager) CreateKey

func (m *Manager) CreateKey(rk *key.RequestKey) (*key.ResponseKey, error)

func (*Manager) DeleteKey

func (m *Manager) DeleteKey(id string) error

func (*Manager) GetKeysByTag

func (m *Manager) GetKeysByTag(tag string) ([]*key.ResponseKey, error)

func (*Manager) UpdateKey

func (m *Manager) UpdateKey(id string, uk *key.UpdateKey) (*key.ResponseKey, error)

type Storage

type Storage interface {
	GetKeysByTag(tag string) ([]*key.ResponseKey, error)
	UpdateKey(id string, key *key.UpdateKey) (*key.ResponseKey, error)
	CreateKey(key *key.RequestKey) (*key.ResponseKey, error)
	DeleteKey(id string) error
}

Jump to

Keyboard shortcuts

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