schema

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	CredentialListLimit = 100
)
View Source
const (
	DefaultSchema = "credential"
)

Variables

View Source
var Objects string
View Source
var Queries string

Functions

This section is empty.

Types

type Credential

type Credential struct {
	CredentialKey
	Description string    `json:"description,omitempty" help:"Credential description, such as what it's for"`
	PV          uint64    `json:"pv,omitempty" help:"Passphrase version it's encrypted with" readonly:""`
	UpdatedAt   time.Time `json:"updated_at" help:"Update timestamp" readonly:""`
}

Credential is the public credential row returned from the database. Secret material and passphrase version are intentionally excluded.

func (Credential) Cell

func (r Credential) Cell(col int) string

func (Credential) Header

func (r Credential) Header() []string

func (*Credential) Scan

func (c *Credential) Scan(row pg.Row) error

Expected column order: key, description, pv, updated_at.

func (Credential) String

func (c Credential) String() string

func (Credential) Width

func (r Credential) Width(col int) int

type CredentialCreate

type CredentialCreate struct {
	CredentialKey
	Credentials any `json:"credentials" help:"Credential value"`
}

CredentialCreate contains the values required to create a credential row. The returned Credential omits PV and Credentials.

func (CredentialCreate) Insert

func (c CredentialCreate) Insert(bind *pg.Bind) (string, error)

func (CredentialCreate) RedactedString

func (c CredentialCreate) RedactedString() string

func (*CredentialCreate) Scan

func (c *CredentialCreate) Scan(row pg.Row) error

Expected column order: key, credential.

func (CredentialCreate) String

func (c CredentialCreate) String() string

func (CredentialCreate) Update

func (c CredentialCreate) Update(_ *pg.Bind) error

type CredentialDescribe

type CredentialDescribe struct {
	Description string
}

CredentialDescribe sets a credential's description, or removes it, when it's empty

func (CredentialDescribe) Insert

func (c CredentialDescribe) Insert(_ *pg.Bind) (string, error)

func (CredentialDescribe) Update

func (c CredentialDescribe) Update(bind *pg.Bind) error

type CredentialGet

type CredentialGet struct {
	CredentialKey
	PV          uint64 `json:"pv" help:"Passphrase version"`
	Credentials any    `json:"credentials" help:"Credential value"`
}

CredentialGet contains the values required to retrieve a credential row. The returned Credential includes PV and Credentials.

func (*CredentialGet) Scan

func (c *CredentialGet) Scan(row pg.Row) error

Expected column order: key, pv, credential.

type CredentialKey

type CredentialKey struct {
	Key string `json:"key" help:"Credential key"`
}

func (CredentialKey) Select

func (c CredentialKey) Select(bind *pg.Bind, op pg.Op) (string, error)

func (CredentialKey) Validate

func (c CredentialKey) Validate() error

Validate returns an error if the key, with surrounding spaces removed, is not an identifier

type CredentialList

type CredentialList struct {
	CredentialListRequest
	Count uint64        `json:"count,omitempty"`
	Body  []*Credential `json:"body,omitempty"`
}

func (*CredentialList) Scan

func (c *CredentialList) Scan(rows pg.Row) error

func (*CredentialList) ScanCount

func (c *CredentialList) ScanCount(row pg.Row) error

func (CredentialList) String

func (c CredentialList) String() string

type CredentialListRequest

type CredentialListRequest struct {
	pg.OffsetLimit
	Rotate *bool `` /* 167-byte string literal not displayed */
}

func (CredentialListRequest) Query

func (r CredentialListRequest) Query() url.Values

func (*CredentialListRequest) Select

func (c *CredentialListRequest) Select(bind *pg.Bind, op pg.Op) (string, error)

func (CredentialListRequest) String

func (c CredentialListRequest) String() string

type CredentialRotate

type CredentialRotate struct {
	CredentialKey
	PV             uint64
	Credentials    []byte
	OldPV          uint64
	OldCredentials []byte
}

CredentialRotate replaces the encrypted credentials for a key, but only if they are still the old encrypted credentials, so that credentials changed or deleted in the meantime are not overwritten.

func (CredentialRotate) Insert

func (c CredentialRotate) Insert(bind *pg.Bind) (string, error)

func (CredentialRotate) Update

func (c CredentialRotate) Update(_ *pg.Bind) error

Jump to

Keyboard shortcuts

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