data_handler

package
v0.0.0-...-a33b67c Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PushSuccess = pb.PushReply{
	Success: true,
}

Functions

This section is empty.

Types

type Event

type Event struct {
	PrimaryKey string
	PipelineID int32
	Payload    Payload
	Rule       *Rule
	Meta       map[string][]byte
}

type Field

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

type Handler

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

func CreateHandler

func CreateHandler(a app.App) *Handler

func (*Handler) EventReceiver

func (handler *Handler) EventReceiver()

func (*Handler) LoadRuleFile

func (handler *Handler) LoadRuleFile(filename string) error

func (*Handler) PreparePipelineData

func (handler *Handler) PreparePipelineData(workerID int32, event *Event) (interface{}, error)

func (*Handler) ProcessEvent

func (handler *Handler) ProcessEvent(eventName string, data []byte, meta map[string][]byte) error

func (*Handler) ProcessPipelineData

func (handler *Handler) ProcessPipelineData(workerID int32, request *Request) error

type MappingConfig

type MappingConfig struct {
	Source  string `json:"source"`
	Target  string `json:"target"`
	Primary bool   `json:"primary"`
}

type Payload

type Payload map[string]interface{}

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"`
}

type RawData

type RawData struct {
	EventName string
	Payload   []byte
	Meta      map[string][]byte
}

type Request

type Request struct {
	PipelineID int32
	Payload    []byte
}

type Rule

type Rule struct {
	Event      string          `json:"event"`
	Collection string          `json:"collection"`
	Method     string          `json:"method"`
	PrimaryKey string          `json:"primaryKey"`
	Mapping    []MappingConfig `json:"mapping"`
}

type RuleConfig

type RuleConfig struct {
	Rules []*Rule `json:"rules"`
}

func LoadRuleFile

func LoadRuleFile(filename string) (*RuleConfig, error)

type Service

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

func NewService

func NewService(a app.App) *Service

func (*Service) Push

func (service *Service) Push(ctx context.Context, in *pb.PushRequest) (*pb.PushReply, error)

func (*Service) PushStream

func (service *Service) PushStream(stream pb.DataHandler_PushStreamServer) error

Jump to

Keyboard shortcuts

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