adversarylab

package
v0.0.0-...-ab13386 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckError

func CheckError(err error)

func NamedTypeHandle

func NamedTypeHandle() codec.Handle

func Ok

func Ok(request []byte) []byte

func RawNamedTypeHandle

func RawNamedTypeHandle() codec.Handle

Types

type Client

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

func Connect

func Connect(url string) Client

func (Client) AddTestPacket

func (self Client) AddTestPacket(dataset string, incoming bool, payload []byte)

func (Client) AddTrainPacket

func (self Client) AddTrainPacket(dataset string, allowBlock bool, incoming bool, payload []byte)

func (Client) GetIncomingRule

func (self Client) GetIncomingRule(dataset string) []byte

func (Client) GetOutgoingRule

func (self Client) GetOutgoingRule(dataset string) []byte

type Named

type Named interface {
	Name() string
}

type NamedType

type NamedType struct {
	Name  string
	Value interface{}
}

type NamedTypeExt

type NamedTypeExt struct{}

func (NamedTypeExt) ConvertExt

func (x NamedTypeExt) ConvertExt(v interface{}) interface{}

From NamedWrapper to NamedType

func (NamedTypeExt) ReadExt

func (x NamedTypeExt) ReadExt(interface{}, []byte)

func (NamedTypeExt) UpdateExt

func (x NamedTypeExt) UpdateExt(dest interface{}, v interface{})

From NamedType to NamedType

func (NamedTypeExt) WriteExt

func (x NamedTypeExt) WriteExt(interface{}) []byte

type PubsubClient

type PubsubClient struct {
	Rules chan Rule
	// contains filtered or unexported fields
}

func PubsubConnect

func PubsubConnect(url string) PubsubClient

type PubsubServer

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

func PubsubListen

func PubsubListen(url string, source PubsubSource) PubsubServer

func (PubsubServer) Pump

func (self PubsubServer) Pump()

type PubsubSource

type PubsubSource chan []byte

type RawNamedType

type RawNamedType struct {
	Name  string
	Value interface{}
}

type Responder

type Responder func([]byte) []byte

type ResultStatus

type ResultStatus int
const (
	Success ResultStatus = iota
	Error
)

type Rule

type Rule struct {
	Dataset       string
	RequireForbid bool
	Incoming      bool
	Sequence      []byte
}

func RuleFromMap

func RuleFromMap(data map[interface{}]interface{}) Rule

type RuleRequest

type RuleRequest struct {
	Dataset  string
	Incoming bool
}

type Server

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

func Listen

func Listen(url string) Server

func (Server) Accept

func (self Server) Accept(responder Responder) []byte

type TestPacket

type TestPacket struct {
	Dataset  string
	Incoming bool
	Payload  []byte
}

func TestPacketFromMap

func TestPacketFromMap(data map[interface{}]interface{}) TestPacket

type TrainPacket

type TrainPacket struct {
	Dataset    string
	AllowBlock bool
	Incoming   bool
	Payload    []byte
}

func TrainPacketFromMap

func TrainPacketFromMap(data map[interface{}]interface{}) TrainPacket

Jump to

Keyboard shortcuts

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