secret

package
v0.0.0-...-d22e7c3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: GPL-3.0 Imports: 5 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 struct {
	// contains filtered or unexported fields
}

Repository of secret

func New

func New(db *sqldb.DB) *Repository

New secret

func (Repository) Create

func (r Repository) Create(ctx context.Context, secret secretentity.Secret) error

Create secret based on secret data

func (Repository) GetSecret

func (r Repository) GetSecret(ctx context.Context, userID int64, secretKey secretentity.Key) (*secretentity.Secret, error)

GetSecret for getting a secret

func (Repository) UpdateSecret

func (r Repository) UpdateSecret(ctx context.Context, secret secretentity.Secret) error

UpdateSecret for updating current secret

type Secret

type Secret struct {
	ID          string           `db:"id"`
	UserID      string           `db:"user_id"`
	SecretKey   secretentity.Key `db:"secret_key"`
	SecretValue string           `db:'secret_value"`
	CreatedAt   time.Time        `db:"created_at"`
	CreatedBy   int64            `db:"created_by"`
	UpdatedAt   pq.NullTime      `db:"updated_at"`
	UpdatedBy   int64            `db:"updated_by"`
	IsTest      bool             `db:"is_test"`
}

Secret of user

Jump to

Keyboard shortcuts

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