Documentation ¶
Index ¶
Constants ¶
const ( // LogLevelNone = 0 LogLevelEgress = 1 LogLevelIngress = 2 LogLevelDebug = 3 )
Log Level constants, use with Logging config
- Level 0: disable debug logging (default)
- Level 1: log only egress traffic
- Level 2: log only ingress traffic
- Level 3: log full content of packets
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Arrow ¶
Arrow is a morphism applied to IO category. The library supports various protocols through definitions of morphisms
type Config ¶
Config defines configuration for the IO category
func SideEffect ¶
SideEffect defines "unsafe" behavior for category
type DnStreamHTTP ¶
DnStreamHTTP specify parameters for HTTP response
type IOCat ¶
type IOCat struct { Fail error HTTP *IOCatHTTP LogLevel int // contains filtered or unexported fields }
IOCat defines the category for abstract I/O with a side-effects
func IO ¶
IO creates the instance of I/O category use Config type to parametrize the behavior. The returned value is used to evaluate program.
type IOCatHTTP ¶
type IOCatHTTP struct { Send *UpStreamHTTP Recv *DnStreamHTTP }
IOCatHTTP defines the category of HTTP I/O
type Mismatch ¶
type Mismatch struct { Diff string Payload interface{} }
Mismatch is returned by api if expectation at body value is failed
type NotSupported ¶
NotSupported is returned if communication schema is not supported.
func (*NotSupported) Error ¶
func (e *NotSupported) Error() string
type Ord ¶
type Ord interface { sort.Interface // String return primary key as string type String(int) string // Value return value at index Value(int) interface{} }
Ord extends sort.Interface with ability to lookup element by string. This interface is a helper abstraction to evaluate presence of element in the sequence.
assay.Join( ... ç.Seq(&seq).Has("example"), ... )
The example above shows a typical usage of Ord interface. The remote peer returns sequence of elements. The lens Seq and Has focuses on the required element. A reference implementation of the interface is
type Seq []MyType func (seq Seq) Len() int { return len(seq) } func (seq Seq) Swap(i, j int) { seq[i], seq[j] = seq[j], seq[i] } func (seq Seq) Less(i, j int) bool { return seq[i].MyKey < seq[j].MyKey } func (seq Seq) String(i int) string { return seq[i].MyKey } func (seq Seq) Value(i int) interface{} { return seq[i] }