wrapper

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterator

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

Iterator is a wrapper for the Iterator interface.

func (Iterator) GetNext

func (i Iterator) GetNext() (string, error)

GetNext returns the next key in the iterator.

func (Iterator) HasNext

func (i Iterator) HasNext() bool

HasNext returns true if there are more keys in the iterator.

type Wrapper

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

Wrapper wraps store functions to provide a more convenient interface, and provides a type-safe way to access the store.

func New

func New(store dataStore) Wrapper

New creates a new wrapper for a store or transaction.

func WrapTransaction added in v1.2.0

func WrapTransaction(ctx context.Context, txHandle transactionHandle,
) (wrapper Wrapper, rollback func(), commit func(context.Context) error, err error)

WrapTransaction initializes a transaction using the given handle, and returns a wrapper for the transaction, as well as rollback and commit functions.

func (Wrapper) AppendUpdateLog

func (s Wrapper) AppendUpdateLog(updateLog string) error

AppendUpdateLog appends new entries to the log and saves it to store.

func (Wrapper) GetActivations

func (s Wrapper) GetActivations(marbleType string) (uint, error)

GetActivations returns activations for a given Marble from store.

func (Wrapper) GetCertificate

func (s Wrapper) GetCertificate(certType string) (*x509.Certificate, error)

GetCertificate returns a certificate from store.

func (Wrapper) GetInfrastructure

func (s Wrapper) GetInfrastructure(infraName string) (quote.InfrastructureProperties, error)

GetInfrastructure returns infrastructure information from store.

func (Wrapper) GetIterator

func (s Wrapper) GetIterator(prefix string) (Iterator, error)

GetIterator returns a wrapped iterator from store.

func (Wrapper) GetManifest

func (s Wrapper) GetManifest() (manifest.Manifest, error)

GetManifest loads the manifest and marshalls it to manifest.Manifest.

func (Wrapper) GetManifestSignature

func (s Wrapper) GetManifestSignature() ([]byte, error)

GetManifestSignature returns the ecdsa signature of the original manifest from store.

func (Wrapper) GetMarble

func (s Wrapper) GetMarble(marbleName string) (manifest.Marble, error)

GetMarble returns information for a specific Marble from store.

func (Wrapper) GetPackage

func (s Wrapper) GetPackage(pkgName string) (quote.PackageProperties, error)

GetPackage returns a Package from store.

func (Wrapper) GetPrivateKey

func (s Wrapper) GetPrivateKey(keyType string) (*ecdsa.PrivateKey, error)

GetPrivateKey returns a private key from store.

func (Wrapper) GetRawManifest

func (s Wrapper) GetRawManifest() ([]byte, error)

GetRawManifest returns the raw manifest from store.

func (Wrapper) GetSecret

func (s Wrapper) GetSecret(secretName string) (manifest.Secret, error)

GetSecret returns a secret from store.

func (Wrapper) GetSecretMap

func (s Wrapper) GetSecretMap() (map[string]manifest.Secret, error)

GetSecretMap returns a map of all secrets.

func (Wrapper) GetState

func (s Wrapper) GetState() (state.State, error)

GetState returns the state from store.

func (Wrapper) GetTLS

func (s Wrapper) GetTLS(tagName string) (manifest.TLStag, error)

GetTLS returns a named t-TLS config from store.

func (Wrapper) GetUpdateLog

func (s Wrapper) GetUpdateLog() (string, error)

GetUpdateLog returns the update log from store.

func (Wrapper) GetUser

func (s Wrapper) GetUser(userName string) (*user.User, error)

GetUser returns user information from store.

func (Wrapper) IncrementActivations

func (s Wrapper) IncrementActivations(marbleType string) error

IncrementActivations is a wrapper for get/put activations to increment the value for one marble.

func (Wrapper) PutCertificate

func (s Wrapper) PutCertificate(certType string, cert *x509.Certificate) error

PutCertificate saves a certificate to store.

func (Wrapper) PutInfrastructure

func (s Wrapper) PutInfrastructure(infraName string, infra quote.InfrastructureProperties) error

PutInfrastructure saves infrastructure information to store.

func (Wrapper) PutManifestSignature

func (s Wrapper) PutManifestSignature(manifestSignature []byte) error

PutManifestSignature saves the manifests signature to store.

func (Wrapper) PutMarble

func (s Wrapper) PutMarble(marbleName string, marble manifest.Marble) error

PutMarble saves Marble information to store.

func (Wrapper) PutPackage

func (s Wrapper) PutPackage(pkgName string, pkg quote.PackageProperties) error

PutPackage saves a Package to store.

func (Wrapper) PutPrivateKey

func (s Wrapper) PutPrivateKey(keyType string, privK *ecdsa.PrivateKey) error

PutPrivateKey saves a private key to store.

func (Wrapper) PutRawManifest

func (s Wrapper) PutRawManifest(manifest []byte) error

PutRawManifest saves the raw manifest to store.

func (Wrapper) PutSecret

func (s Wrapper) PutSecret(secretName string, secret manifest.Secret) error

PutSecret saves a secret to store.

func (Wrapper) PutState

func (s Wrapper) PutState(currState state.State) error

PutState saves the state to store.

func (Wrapper) PutTLS

func (s Wrapper) PutTLS(tagName string, tag manifest.TLStag) error

PutTLS saves a t-TLS config to store.

func (Wrapper) PutUpdateLog

func (s Wrapper) PutUpdateLog(updateLog string) error

PutUpdateLog saves the update log to store.

func (Wrapper) PutUser

func (s Wrapper) PutUser(newUser *user.User) error

PutUser saves user information to store.

Directories

Path Synopsis
Package testutil provides utility functions to access store values in unit tests.
Package testutil provides utility functions to access store values in unit tests.

Jump to

Keyboard shortcuts

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