postgres

package
v0.0.0-...-7fca2f4 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c *config.Config) (backend.Backend, error)

New provides initialization of postgres for store master pass

Types

type Mystery

type Mystery struct {
	ID             uint64    `gorm:"primaryKey;AUTO_INCREMENT;NOT NULL"`
	Namespace      string    `gorm:"NOT NULL"`
	Data           []byte    `gorm:"NOT NULL"`
	UserID         string    `gorm:"index"`
	CreatedAt      time.Time `gorm:"NOT NULL"`
	CurrentVersion uint64    `gorm:"NOT NULL;default:0"`
	MaxVersion     uint64    `gorm:"NOT NULL;default:0"`
	Compressed     bool
	ExpiredAfter   *time.Duration
	UpdatedAt      time.Time
}

Mystery defines structure for store in Postgres

type Postgres

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

Postgres defines backend for postgres

func (*Postgres) Delete

func (m *Postgres) Delete(masterKey, namespace []byte) error

Delete defines deleting secret from backend

func (*Postgres) Get

func (m *Postgres) Get(masterKey, namespace []byte) (backend.Secret, error)

Get defines getting a secret from backend

func (*Postgres) List

func (m *Postgres) List(masterKey []byte) ([]backend.MysteryResp, error)

List defines getting list of secrets

func (*Postgres) Put

func (m *Postgres) Put(masterKey []byte, secret backend.Secret) error

Put defines putting a secret to backend

func (*Postgres) Update

func (m *Postgres) Update(masterKey []byte, secret backend.Secret) error

Update provides updating of data

Jump to

Keyboard shortcuts

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