gravity_sdk_types_projection

package
v0.0.46 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToRecord

func ConvertToRecord(pj *Projection, record *gravity_sdk_types_record.Record) error

func Marshal added in v0.0.13

func Marshal(pj *Projection) ([]byte, error)

func StrToBytes

func StrToBytes(s string) []byte

func Unmarshal

func Unmarshal(data []byte, pj *Projection) error

Types

type Field

type Field struct {
	Name    string      `json:"name"`
	Value   interface{} `json:"value"`
	Primary bool        `json:"primary"`
}

type JSONResult

type JSONResult struct {
	EventName  string                 `json:"event"`
	Collection string                 `json:"collection"`
	Payload    map[string]interface{} `json:"payload"`
	Meta       map[string][]byte      `json:"meta"`
}

type Projection

type Projection struct {
	EventName  string            `json:"event"`
	Collection string            `json:"collection"`
	Method     string            `json:"method"`
	PrimaryKey string            `json:"primaryKey"`
	Fields     []Field           `json:"fields"`
	Meta       map[string][]byte `json:"meta"`
}

func (*Projection) GetPayload added in v0.0.13

func (pj *Projection) GetPayload() map[string]interface{}

func (*Projection) ToJSON

func (pj *Projection) ToJSON() ([]byte, error)

func (*Projection) ToRecord

func (pj *Projection) ToRecord() (*gravity_sdk_types_record.Record, error)

Jump to

Keyboard shortcuts

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