Documentation ¶
Index ¶
- Constants
- func NewJSONFromByes(b []byte) snapshots.Comparable
- func NewJSONFromString(s string) snapshots.Comparable
- func NewPrettyStringComparable(s string) snapshots.Comparable
- func NewStringComparable(s string) snapshots.Comparable
- type JSON
- func (j *JSON) CompareTo(c snapshots.Comparable) (string, error)
- func (j *JSON) Dump() []byte
- func (j *JSON) Extension() string
- func (j *JSON) Kind() snapshots.Kind
- func (j *JSON) Load(rawJSON []byte) snapshots.Comparable
- func (j *JSON) Replace(rs map[string]string)
- func (j *JSON) ReplaceSubtypes(_ map[snapshots.Kind]map[string]string)
- func (j *JSON) String() string
- func (j *JSON) Subtypes() bool
- type PrettyStringComparable
- type Response
- func (r *Response) CompareTo(c snapshots.Comparable) (string, error)
- func (r *Response) Dump() []byte
- func (r *Response) Extension() string
- func (r *Response) Kind() snapshots.Kind
- func (r *Response) Load(req []byte) snapshots.Comparable
- func (r *Response) RegisterHandler(contentType string, h func(string) snapshots.Comparable)
- func (r *Response) Replace(m map[string]string)
- func (r *Response) ReplaceSubtypes(replacers map[snapshots.Kind]map[string]string)
- func (r *Response) String() string
- func (r *Response) Subtypes() bool
- type StringComparable
- func (s *StringComparable) CompareTo(c snapshots.Comparable) (string, error)
- func (s *StringComparable) Dump() []byte
- func (s *StringComparable) Extension() string
- func (s *StringComparable) Kind() snapshots.Kind
- func (s *StringComparable) Load(rawS []byte) snapshots.Comparable
- func (s *StringComparable) Replace(r map[string]string)
- func (s *StringComparable) ReplaceSubtypes(_ map[snapshots.Kind]map[string]string)
- func (s *StringComparable) String() string
- func (s *StringComparable) Subtypes() bool
Constants ¶
View Source
const DefaultContextSize = 3
View Source
const KindJSON snapshots.Kind = "json"
View Source
const KindString snapshots.Kind = "string"
Variables ¶
This section is empty.
Functions ¶
func NewJSONFromByes ¶ added in v0.0.6
func NewJSONFromByes(b []byte) snapshots.Comparable
func NewJSONFromString ¶
func NewJSONFromString(s string) snapshots.Comparable
func NewPrettyStringComparable ¶
func NewPrettyStringComparable(s string) snapshots.Comparable
NewPrettyStringComparable constructs a PrettyStringComparable from a string.
func NewStringComparable ¶
func NewStringComparable(s string) snapshots.Comparable
NewStringComparable constructs a StringComparable from a string.
Types ¶
type JSON ¶
type JSON struct {
// contains filtered or unexported fields
}
func (*JSON) ReplaceSubtypes ¶ added in v0.0.8
type PrettyStringComparable ¶
type PrettyStringComparable struct {
StringComparable
}
func (*PrettyStringComparable) CompareTo ¶
func (s *PrettyStringComparable) CompareTo(c snapshots.Comparable) (string, error)
func (*PrettyStringComparable) Load ¶
func (s *PrettyStringComparable) Load(rawS []byte) snapshots.Comparable
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response holds comparable information of a http response.
func NewResponse ¶
NewResponse returns a new instance of Response
func (*Response) RegisterHandler ¶
func (r *Response) RegisterHandler(contentType string, h func(string) snapshots.Comparable)
RegisterHandler will store in the response comparable a handler for a content-type
func (*Response) ReplaceSubtypes ¶ added in v0.0.8
type StringComparable ¶
type StringComparable struct {
// contains filtered or unexported fields
}
func (*StringComparable) CompareTo ¶
func (s *StringComparable) CompareTo(c snapshots.Comparable) (string, error)
func (*StringComparable) Dump ¶
func (s *StringComparable) Dump() []byte
func (*StringComparable) Extension ¶
func (s *StringComparable) Extension() string
func (*StringComparable) Kind ¶
func (s *StringComparable) Kind() snapshots.Kind
func (*StringComparable) Load ¶
func (s *StringComparable) Load(rawS []byte) snapshots.Comparable
func (*StringComparable) Replace ¶
func (s *StringComparable) Replace(r map[string]string)
func (*StringComparable) ReplaceSubtypes ¶ added in v0.0.8
func (s *StringComparable) ReplaceSubtypes(_ map[snapshots.Kind]map[string]string)
func (*StringComparable) String ¶
func (s *StringComparable) String() string
func (*StringComparable) Subtypes ¶ added in v0.0.8
func (s *StringComparable) Subtypes() bool
Click to show internal directories.
Click to hide internal directories.