secret

package
v0.0.0-...-9828505 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository interface {
	Create(utildb.DB, secretify.Secret) (secretify.Secret, error)
	ViewByIdentifier(utildb.DB, string) (secretify.Secret, error)
	Delete(utildb.DB, string) error
	ViewAllExpired(utildb.DB) ([]secretify.Secret, error)
	DeleteExpired(utildb.DB) error
}

Repository represents secret repository interface

type Secret

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

Secret represents secret application service

func Initialize

func Initialize(db utildb.DB, cfgSvc setting.Service, fileSvc file.Service) *Secret

Initialize initalizes secret application service with defaults

func New

func New(db utildb.DB, sdb Repository, cfgSvc setting.Service, fileSvc file.Service) *Secret

New creates new secret application service

func (*Secret) Create

func (s *Secret) Create(ciphertext string, hasPassphrase bool, expiresAt time.Time, revealOnce bool, destroyManual bool, fileID int) (secretify.Secret, error)

Create creates a new encrypted secret

func (*Secret) CreateWithFile

func (s *Secret) CreateWithFile(ciphertext string, hasPassphrase bool, expiresAt time.Time, revealOnce bool, destroyManual bool, fileIdentifier string) (secretify.Secret, error)

Create creates a new encrypted secret with an encrypted file

func (*Secret) Delete

func (s *Secret) Delete(identifier string) error

Delete the secret

func (*Secret) DeleteExpired

func (s *Secret) DeleteExpired() error

DeleteExpired all expired secrets (and associated files)

func (*Secret) ServiceConfig

func (s *Secret) ServiceConfig() setting.Service

func (*Secret) View

func (s *Secret) View(identifier string, onlyMeta bool) (secret secretify.Secret, deleted bool, err error)

View returns the secret's information, deletes it afterwards and sends an email if configured

type Service

type Service interface {
	Create(ciphertext string, hasPassphrase bool, expiresAt time.Time, revealOnce bool, destroyManual bool, fileID int) (secretify.Secret, error)
	CreateWithFile(ciphertext string, hasPassphrase bool, expiresAt time.Time, revealOnce bool, destroyManual bool, fileIdentifier string) (secretify.Secret, error)
	View(identifier string, onlyMeta bool) (secret secretify.Secret, deleted bool, err error)
	Delete(identifier string) error
	DeleteExpired() error
	ServiceConfig() setting.Service
}

Service represents secret application interface

Directories

Path Synopsis
plattform

Jump to

Keyboard shortcuts

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