Documentation
¶
Index ¶
- func RemarshalProto(namespace string, obj map[string]interface{}) (_ protoreflect.ProtoMessage, err error)
- type FixtureType
- type Library
- func (lib *Library) Close() (err error)
- func (lib *Library) CompareFixture(namespace, key string, obj interface{}, removeExtra, removeSerials bool) (matches bool, err error)
- func (lib *Library) ConnectTrtl(ctx context.Context) (conn *grpc.ClientConn, err error)
- func (lib *Library) DBPath() string
- func (lib *Library) FixtureType() FixtureType
- func (lib *Library) Fixtures() map[string]map[string]interface{}
- func (lib *Library) GenerateDB(ftype FixtureType) (err error)
- func (lib *Library) GetCert(name string) (cert *models.Certificate, err error)
- func (lib *Library) GetCertReq(name string) (certReq *models.CertificateRequest, err error)
- func (lib *Library) GetVASP(name string) (vasp *pb.VASP, err error)
- func (lib *Library) Load(t FixtureType) (err error)
- func (lib *Library) LoadReferenceFixtures() (err error)
- func (lib *Library) Reset()
- func (lib *Library) ResetDB() (err error)
- func (lib *Library) SetupTrtl() (err error)
- func (lib *Library) ShutdownTrtl() (err error)
- func (lib *Library) StoreType() StoreType
- type StoreType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RemarshalProto ¶
func RemarshalProto(namespace string, obj map[string]interface{}) (_ protoreflect.ProtoMessage, err error)
Types ¶
type Library ¶
type Library struct {
// contains filtered or unexported fields
}
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 (*Library) FixtureType ¶
func (lib *Library) FixtureType() FixtureType
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) GetCertReq ¶
func (*Library) Load ¶
func (lib *Library) Load(t FixtureType) (err error)
func (*Library) LoadReferenceFixtures ¶
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) SetupTrtl ¶
SetupTrtl starts the Trtl server, which must be done before calling GenerateDB.