Documentation
¶
Index ¶
- Variables
- func DirToMap(dir string) (map[string]interface{}, error)
- func EncodePEMCert(cert *x509.Certificate) string
- func EncodePEMKey(key *rsa.PrivateKey) string
- func GenerateCert(t *testing.T, isCA bool, host string, signer *x509.Certificate, ...) (*x509.Certificate, *rsa.PrivateKey)
- func IsoToMap(isoPath string) (map[string]interface{}, error)
- type ChildRecorder
- type Record
- type Recorder
- type TestCommand
- type TopLevelRecorder
Constants ¶
This section is empty.
Variables ¶
var NullRecorder = &nullRecorder{}
NullRecorder ignores all the items passed to it via Rec.
Functions ¶
func DirToMap ¶
DirToMap converts directory to a map where keys are filenames without full path and values are the contents of the files. Files with '.iso' extensions are unpacked using 7z and then converted to a map using DirToMap. Directories are handled recursively. If the directory doesn't exist, dirToMap returns nil
func EncodePEMCert ¶
func EncodePEMCert(cert *x509.Certificate) string
func EncodePEMKey ¶
func EncodePEMKey(key *rsa.PrivateKey) string
func GenerateCert ¶
func GenerateCert(t *testing.T, isCA bool, host string, signer *x509.Certificate, key *rsa.PrivateKey) (*x509.Certificate, *rsa.PrivateKey)
Types ¶
type ChildRecorder ¶
type ChildRecorder struct {
// contains filtered or unexported fields
}
ChildRecorder is a recorder that prefixes the names of its items with the specified prefix and then passes them to its parent recorder.
func NewChildRecorder ¶
func NewChildRecorder(parent Recorder, prefix string) *ChildRecorder
NewChildRecorder creates a new ChildRecorder.
func (*ChildRecorder) Child ¶
func (r *ChildRecorder) Child(prefix string) *ChildRecorder
Child creates a Child recorder for this recorder.
func (*ChildRecorder) Rec ¶
func (r *ChildRecorder) Rec(name string, data interface{})
Rec implements Rec method of Recorder interface.
type Record ¶
type Record struct { Name string `json:"name"` Value interface{} `json:"value,omitempty"` }
Record denotes an item saved by Recorder's Rec method.
type Recorder ¶
type Recorder interface { // Rec adds an item to Recorder using the specified name and data. Rec(name string, data interface{}) }
Recorder is used to record various events for use in tests.
type TestCommand ¶
func RunProcess ¶
RunProcess runs a background process with specified args and appending env to the current environment.
func (*TestCommand) Pid ¶
func (tc *TestCommand) Pid() int
func (*TestCommand) Stop ¶
func (tc *TestCommand) Stop()
type TopLevelRecorder ¶
type TopLevelRecorder struct {
// contains filtered or unexported fields
}
TopLevelRecorder records the items as-is, optionally applying filters to them. It can also create child recorders and give back its current contents.
func NewToplevelRecorder ¶
func NewToplevelRecorder() *TopLevelRecorder
NewToplevelRecorder creates a new TopLevelRecorder.
func (*TopLevelRecorder) AddFilter ¶
func (r *TopLevelRecorder) AddFilter(filter string)
AddFilter adds a new filter substring to the TopLevelRecorder. If any filter substrings are specified, Rec will ignore items with names that don't include any of these substrings (i.e. the filters are ORed)
func (*TopLevelRecorder) Child ¶
func (r *TopLevelRecorder) Child(prefix string) *ChildRecorder
Child creates a Child recorder for this TopLevelRecorder that will add the specified prefix (plus ": ") to the names of items it records.
func (*TopLevelRecorder) Content ¶
func (r *TopLevelRecorder) Content() []*Record
Content returns the current contents of the recorder.
func (*TopLevelRecorder) Rec ¶
func (r *TopLevelRecorder) Rec(name string, value interface{})
Rec implements Rec method of Recorder interface.