spec

package
v0.0.0-...-05bd1a1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthSpec = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSpec   = fmt.Errorf("proto: integer overflow")
)

Functions

func Decorate

func Decorate(g *geoip2.Reader, r *http.Request, e *Envelope) error

func ValidateContext

func ValidateContext(ctx *Context) error

func ValidateEnvelope

func ValidateEnvelope(envelope *Envelope) error

Types

type AccessToken

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

func NewAccessToken

func NewAccessToken() *AccessToken

func (*AccessToken) AllowContext

func (at *AccessToken) AllowContext(c *Context) bool

func (*AccessToken) AllowEnvelope

func (at *AccessToken) AllowEnvelope(e *Envelope) bool

type Context

type Context struct {
	Properties  []KV   `protobuf:"bytes,2,rep,name=properties,proto3" json:"properties"`
	CreatedAtNs int64  `protobuf:"varint,5,opt,name=created_at_ns,json=createdAtNs,proto3" json:"created_at_ns,omitempty"`
	ForeignId   string `protobuf:"bytes,6,opt,name=foreign_id,json=foreignId,proto3" json:"foreign_id,omitempty"`
	ForeignType string `protobuf:"bytes,7,opt,name=foreign_type,json=foreignType,proto3" json:"foreign_type,omitempty"`
}

func (*Context) Descriptor

func (*Context) Descriptor() ([]byte, []int)

func (*Context) GetCreatedAtNs

func (m *Context) GetCreatedAtNs() int64

func (*Context) GetForeignId

func (m *Context) GetForeignId() string

func (*Context) GetForeignType

func (m *Context) GetForeignType() string

func (*Context) GetProperties

func (m *Context) GetProperties() []KV

func (*Context) Marshal

func (m *Context) Marshal() (dAtA []byte, err error)

func (*Context) MarshalTo

func (m *Context) MarshalTo(dAtA []byte) (int, error)

func (*Context) MarshalToSizedBuffer

func (m *Context) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Context) ProtoMessage

func (*Context) ProtoMessage()

func (*Context) Reset

func (m *Context) Reset()

func (*Context) Size

func (m *Context) Size() (n int)

func (*Context) String

func (m *Context) String() string

func (*Context) Unmarshal

func (m *Context) Unmarshal(dAtA []byte) error

func (*Context) XXX_DiscardUnknown

func (m *Context) XXX_DiscardUnknown()

func (*Context) XXX_Marshal

func (m *Context) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Context) XXX_Merge

func (m *Context) XXX_Merge(src proto.Message)

func (*Context) XXX_Size

func (m *Context) XXX_Size() int

func (*Context) XXX_Unmarshal

func (m *Context) XXX_Unmarshal(b []byte) error

type Envelope

type Envelope struct {
	Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	Payload  []byte    `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
}

func DecodeAndFlatten

func DecodeAndFlatten(body io.Reader) (*Envelope, error)

func (*Envelope) Descriptor

func (*Envelope) Descriptor() ([]byte, []int)

func (*Envelope) GetMetadata

func (m *Envelope) GetMetadata() *Metadata

func (*Envelope) GetPayload

func (m *Envelope) GetPayload() []byte

func (*Envelope) Marshal

func (m *Envelope) Marshal() (dAtA []byte, err error)

func (*Envelope) MarshalTo

func (m *Envelope) MarshalTo(dAtA []byte) (int, error)

func (*Envelope) MarshalToSizedBuffer

func (m *Envelope) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Envelope) ProtoMessage

func (*Envelope) ProtoMessage()

func (*Envelope) Reset

func (m *Envelope) Reset()

func (*Envelope) Size

func (m *Envelope) Size() (n int)

func (*Envelope) String

func (m *Envelope) String() string

func (*Envelope) Unmarshal

func (m *Envelope) Unmarshal(dAtA []byte) error

func (*Envelope) XXX_DiscardUnknown

func (m *Envelope) XXX_DiscardUnknown()

func (*Envelope) XXX_Marshal

func (m *Envelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Envelope) XXX_Merge

func (m *Envelope) XXX_Merge(src proto.Message)

func (*Envelope) XXX_Size

func (m *Envelope) XXX_Size() int

func (*Envelope) XXX_Unmarshal

func (m *Envelope) XXX_Unmarshal(b []byte) error

type JsonFrame

type JsonFrame struct {
	Search      map[string]interface{} `json:"search"`
	Count       map[string]interface{} `json:"count"`
	Properties  map[string]interface{} `json:"properties"`
	CreatedAtNs int64                  `json:"created_at_ns"`
	ForeignId   string                 `json:"foreign_id"`
	ForeignType string                 `json:"foreign_type"`
	EventType   string                 `json:"event_type"`
	Payload     interface{}            `json:"payload"`
}

type KV

type KV struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}

func Transform

func Transform(m map[string]interface{}, expand bool) ([]KV, error)

func (*KV) Descriptor

func (*KV) Descriptor() ([]byte, []int)

func (*KV) GetKey

func (m *KV) GetKey() string

func (*KV) GetValue

func (m *KV) GetValue() string

func (*KV) Marshal

func (m *KV) Marshal() (dAtA []byte, err error)

func (*KV) MarshalTo

func (m *KV) MarshalTo(dAtA []byte) (int, error)

func (*KV) MarshalToSizedBuffer

func (m *KV) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*KV) ProtoMessage

func (*KV) ProtoMessage()

func (*KV) Reset

func (m *KV) Reset()

func (*KV) Size

func (m *KV) Size() (n int)

func (*KV) String

func (m *KV) String() string

func (*KV) Unmarshal

func (m *KV) Unmarshal(dAtA []byte) error

func (*KV) XXX_DiscardUnknown

func (m *KV) XXX_DiscardUnknown()

func (*KV) XXX_Marshal

func (m *KV) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*KV) XXX_Merge

func (m *KV) XXX_Merge(src proto.Message)

func (*KV) XXX_Size

func (m *KV) XXX_Size() int

func (*KV) XXX_Unmarshal

func (m *KV) XXX_Unmarshal(b []byte) error

type Metadata

type Metadata struct {
	Search      []KV              `protobuf:"bytes,1,rep,name=search,proto3" json:"search"`
	Count       []KV              `protobuf:"bytes,2,rep,name=count,proto3" json:"count"`
	Properties  []KV              `protobuf:"bytes,3,rep,name=properties,proto3" json:"properties"`
	CreatedAtNs int64             `protobuf:"varint,5,opt,name=created_at_ns,json=createdAtNs,proto3" json:"created_at_ns,omitempty"`
	EventType   string            `protobuf:"bytes,7,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"`
	ForeignId   string            `protobuf:"bytes,9,opt,name=foreign_id,json=foreignId,proto3" json:"foreign_id,omitempty"`
	ForeignType string            `protobuf:"bytes,10,opt,name=foreign_type,json=foreignType,proto3" json:"foreign_type,omitempty"`
	Track       map[string]uint32 `` /* 153-byte string literal not displayed */
	Id          uint64            `protobuf:"fixed64,12,opt,name=id,proto3" json:"id,omitempty"`
}

func (*Metadata) Descriptor

func (*Metadata) Descriptor() ([]byte, []int)

func (*Metadata) GetCount

func (m *Metadata) GetCount() []KV

func (*Metadata) GetCreatedAtNs

func (m *Metadata) GetCreatedAtNs() int64

func (*Metadata) GetEventType

func (m *Metadata) GetEventType() string

func (*Metadata) GetForeignId

func (m *Metadata) GetForeignId() string

func (*Metadata) GetForeignType

func (m *Metadata) GetForeignType() string

func (*Metadata) GetId

func (m *Metadata) GetId() uint64

func (*Metadata) GetProperties

func (m *Metadata) GetProperties() []KV

func (*Metadata) GetSearch

func (m *Metadata) GetSearch() []KV

func (*Metadata) GetTrack

func (m *Metadata) GetTrack() map[string]uint32

func (*Metadata) Marshal

func (m *Metadata) Marshal() (dAtA []byte, err error)

func (*Metadata) MarshalTo

func (m *Metadata) MarshalTo(dAtA []byte) (int, error)

func (*Metadata) MarshalToSizedBuffer

func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) Reset

func (m *Metadata) Reset()

func (*Metadata) Size

func (m *Metadata) Size() (n int)

func (*Metadata) String

func (m *Metadata) String() string

func (*Metadata) Unmarshal

func (m *Metadata) Unmarshal(dAtA []byte) error

func (*Metadata) XXX_DiscardUnknown

func (m *Metadata) XXX_DiscardUnknown()

func (*Metadata) XXX_Marshal

func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Metadata) XXX_Merge

func (m *Metadata) XXX_Merge(src proto.Message)

func (*Metadata) XXX_Size

func (m *Metadata) XXX_Size() int

func (*Metadata) XXX_Unmarshal

func (m *Metadata) XXX_Unmarshal(b []byte) error

type TokenToProduct

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

func NewTokenMap

func NewTokenMap(toproduct, tocontext string) *TokenToProduct

func (*TokenToProduct) ExtractFromRequest

func (tp *TokenToProduct) ExtractFromRequest(r *http.Request) *AccessToken

func (*TokenToProduct) ExtractFromToken

func (tp *TokenToProduct) ExtractFromToken(token string) *AccessToken

Jump to

Keyboard shortcuts

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