fixtures

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearContactEmailLogs added in v1.6.0

func ClearContactEmailLogs(vasp *pb.VASP) (err error)

ClearContactEmailLogs clears the contact email logs on a VASP object. Tests which assert against state on the contact email logs should call this method to ensure that the logs are empty before reaching the test point.

func RemarshalProto

func RemarshalProto(namespace string, obj map[string]interface{}) (_ protoreflect.ProtoMessage, err error)

Types

type FixtureType

type FixtureType uint8
const (
	Unknown FixtureType = iota
	Empty
	Small
	Full
)

type Library

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

func New

func New(fixturesPath, dbPath string, stype StoreType) (lib *Library, err error)

func (*Library) Close

func (lib *Library) Close() (err error)

func (*Library) CompareFixture

func (lib *Library) CompareFixture(namespace, key string, obj interface{}, removeExtra, removeSerials bool) (matches bool, err error)

CompareFixture returns True if the given object matches the object in the fixtures library. This is used in tests to verify the correctness of the reference library, and to verify endpoints that return unmodified objects from the database.

func (*Library) ConnectTrtl

func (lib *Library) ConnectTrtl(ctx context.Context) (conn *grpc.ClientConn, err error)

func (*Library) DBPath

func (lib *Library) DBPath() string

func (*Library) FixtureType

func (lib *Library) FixtureType() FixtureType

func (*Library) Fixtures

func (lib *Library) Fixtures() map[string]map[string]interface{}

func (*Library) GenerateDB

func (lib *Library) GenerateDB(ftype FixtureType) (err error)

generateDB generates an updated database and compresses it to a gzip file. Note: This also generates a temporary directory which the suite teardown should clean up.

func (*Library) GetCert

func (lib *Library) GetCert(name string) (cert *models.Certificate, err error)

func (*Library) GetCertReq

func (lib *Library) GetCertReq(name string) (certReq *models.CertificateRequest, err error)

func (*Library) GetContact added in v1.7.1

func (lib *Library) GetContact(name string) (contact *models.Contact, err error)

func (*Library) GetVASP

func (lib *Library) GetVASP(name string) (vasp *pb.VASP, err error)

func (*Library) Load

func (lib *Library) Load(t FixtureType) (err error)

func (*Library) LoadReferenceFixtures

func (lib *Library) LoadReferenceFixtures() (err error)

Load reference fixtures into the fixtures map; the reference fixtures contain all possible fixtures that can be in any fixture database. The fixtures themselves are a mapping of namespace to a map of ID strings to the unmarshaled value. E.g. to get the expected value for VASP 1234 you would use s.fixtures[vasps]["1234"]

func (*Library) Reset

func (lib *Library) Reset()

func (*Library) ResetDB

func (lib *Library) ResetDB() (err error)

func (*Library) SetupTrtl

func (lib *Library) SetupTrtl() (err error)

SetupTrtl starts the Trtl server, which must be done before calling GenerateDB.

func (*Library) ShutdownTrtl

func (lib *Library) ShutdownTrtl() (err error)

func (*Library) StoreType

func (lib *Library) StoreType() StoreType

type StoreType

type StoreType uint8
const (
	StoreUnknown StoreType = iota
	StoreLevelDB
	StoreTrtl
)

Jump to

Keyboard shortcuts

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