api

package
v0.393.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.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 AsyncSubKey

type AsyncSubKey struct{}

AsyncSubKey is a type that represents the subkey for async.

func (AsyncSubKey) SubKey

func (AsyncSubKey) SubKey() string

type DataEncryptor

type DataEncryptor interface {
	Encrypt(cleartext []byte, dest Encrypted) error
	Decrypt(encrypted Encrypted) ([]byte, error)
}

type Encrypted

type Encrypted interface {
	SubKey() string
	Bytes() []byte
	Set(data []byte)
}

Encrypted is an interface for values that contain encrypted data.

type EncryptedAsyncColumn

type EncryptedAsyncColumn = EncryptedColumn[AsyncSubKey]

type EncryptedColumn

type EncryptedColumn[SK SubKey] struct {
	// contains filtered or unexported fields
}

EncryptedColumn is a type that represents an encrypted column.

It can be used by sqlc to map to/from a bytea column in the database.

func (*EncryptedColumn[SK]) Bytes

func (e *EncryptedColumn[SK]) Bytes() []byte

func (*EncryptedColumn[SK]) GoString

func (e *EncryptedColumn[SK]) GoString() string

func (*EncryptedColumn[SK]) Scan

func (e *EncryptedColumn[SK]) Scan(src interface{}) error

func (*EncryptedColumn[SK]) Set

func (e *EncryptedColumn[SK]) Set(b []byte)

func (*EncryptedColumn[SK]) SubKey

func (e *EncryptedColumn[SK]) SubKey() string

func (EncryptedColumn[SK]) Value

func (e EncryptedColumn[SK]) Value() (driver.Value, error)

type EncryptedIdentityColumn added in v0.370.0

type EncryptedIdentityColumn = EncryptedColumn[IdentityKeySubKey]

type EncryptedTimelineColumn

type EncryptedTimelineColumn = EncryptedColumn[TimelineSubKey]

type IdentityKeySubKey added in v0.370.0

type IdentityKeySubKey struct{}

IdentityKeySubKey is a type that represents the subkey for identity keys.

func (IdentityKeySubKey) SubKey added in v0.370.0

func (IdentityKeySubKey) SubKey() string

type KeyStoreProvider

type KeyStoreProvider interface {
	// EnsureKey asks a provider to check for an encrypted key.
	// If not available, call the generateKey function to create a new key.
	// The provider should handle transactions around checking and setting the key, to prevent race conditions.
	EnsureKey(ctx context.Context, generateKey func() ([]byte, error)) ([]byte, error)
}

type OptionalEncryptedAsyncColumn

type OptionalEncryptedAsyncColumn = optional.Option[EncryptedAsyncColumn]

type OptionalEncryptedTimelineColumn

type OptionalEncryptedTimelineColumn = optional.Option[EncryptedTimelineColumn]

type SubKey

type SubKey interface{ SubKey() string }

SubKey is an interface for types that specify their own encryption subkey.

type TimelineSubKey

type TimelineSubKey struct{}

TimelineSubKey is a type that represents the subkey for logs.

func (TimelineSubKey) SubKey

func (TimelineSubKey) SubKey() string

Jump to

Keyboard shortcuts

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