spade

package
v0.0.0-...-7e90556 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2018 License: MIT, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const COMPRESSION_VERSION byte = 1
View Source
const EXTERNAL_EDGE = "external"
View Source
const INTERNAL_EDGE = "internal"
View Source
const PROTOCOL_VERSION = 4

This might be a really bad idea, perhaps the version should be defined in the clients of this code, as it current stands we cannot move one without the other. Recommended ways to solve this sort of thing in Protobuf and Thrift is to have your namespace dicate version

Variables

View Source
var SpaceEncoding = base64.NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 /")

SpaceEncoding is to work around the fact that we decode `+` in query strings into ` `. https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1 allows `+` to represent either since `+` is not a reserved character in RFC1738... It is the StdEncoding with ` ` substituting for `+`.

Functions

func Compress

func Compress(e *Event) ([]byte, error)

func DetermineBase64Encoding

func DetermineBase64Encoding(data []byte) *base64.Encoding

DetermineBase64Encoding returns the encoding most likely to work on the given data.

func Marshal

func Marshal(src *Event) ([]byte, error)

func Unmarshal

func Unmarshal(b []byte, dst *Event) error

Types

type Event

type Event struct {
	ReceivedAt    time.Time `json:"receivedAt"`
	ClientIp      net.IP    `json:"clientIp"`
	XForwardedFor string    `json:"xForwardedFor"`
	Uuid          string    `json:"uuid"`
	Data          string    `json:"data"`
	UserAgent     string    `json:"userAgent"`
	Version       int       `json:"recordversion"`
	EdgeType      string    `json:"edgeType"`
}

func Decompress

func Decompress(c []byte) (*Event, error)

func Deglob

func Deglob(glob []byte) (events []*Event, err error)

func NewEvent

func NewEvent(receivedAt time.Time, clientIp net.IP, xForwardedFor, uuid, data, userAgent string, edgeType string) *Event

Jump to

Keyboard shortcuts

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