model

package
v0.0.0-...-e7aca54 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package model is a generated protocol buffer package.

It is generated from these files:

model/Commander.proto

It has these top-level messages:

UUID
CommandParams
Command
PagedCommands
Event
PagedEvents
PagingInfo
StreamRequest

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func B2S

func B2S(bs []uint8) string

Types

type Command

type Command struct {
	Id        *UUID             `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Action    string            `protobuf:"bytes,2,opt,name=action" json:"action,omitempty"`
	Data      string            `protobuf:"bytes,3,opt,name=data" json:"data,omitempty"`
	Timestamp int64             `protobuf:"varint,4,opt,name=timestamp" json:"timestamp,omitempty"`
	Topic     string            `protobuf:"bytes,5,opt,name=topic" json:"topic,omitempty"`
	Partition int32             `protobuf:"varint,6,opt,name=partition" json:"partition,omitempty"`
	Offset    int64             `protobuf:"varint,7,opt,name=offset" json:"offset,omitempty"`
	Children  []*UUID           `protobuf:"bytes,8,rep,name=children" json:"children,omitempty"`
	Carrier   map[string]string `` /* 134-byte string literal not displayed */
}

func (*Command) Descriptor

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

func (*Command) GetAction

func (m *Command) GetAction() string

func (*Command) GetCarrier

func (m *Command) GetCarrier() map[string]string

func (*Command) GetChildren

func (m *Command) GetChildren() []*UUID

func (*Command) GetData

func (m *Command) GetData() string

func (*Command) GetId

func (m *Command) GetId() *UUID

func (*Command) GetOffset

func (m *Command) GetOffset() int64

func (*Command) GetPartition

func (m *Command) GetPartition() int32

func (*Command) GetTimestamp

func (m *Command) GetTimestamp() int64

func (*Command) GetTopic

func (m *Command) GetTopic() string

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) Reset

func (m *Command) Reset()

func (*Command) String

func (m *Command) String() string

type CommandParams

type CommandParams struct {
	Action  string            `protobuf:"bytes,1,opt,name=action" json:"action,omitempty"`
	Data    string            `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"`
	Sync    bool              `protobuf:"varint,3,opt,name=sync" json:"sync,omitempty"`
	Carrier map[string]string `` /* 134-byte string literal not displayed */
}

func (*CommandParams) Descriptor

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

func (*CommandParams) GetAction

func (m *CommandParams) GetAction() string

func (*CommandParams) GetCarrier

func (m *CommandParams) GetCarrier() map[string]string

func (*CommandParams) GetData

func (m *CommandParams) GetData() string

func (*CommandParams) GetSync

func (m *CommandParams) GetSync() bool

func (*CommandParams) ProtoMessage

func (*CommandParams) ProtoMessage()

func (*CommandParams) Reset

func (m *CommandParams) Reset()

func (*CommandParams) String

func (m *CommandParams) String() string

type DB

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

DB holds db conn info

func NewDB

func NewDB(host, dbname, user, pass, sslMode string) *DB

NewDB constructs a new DB NewDB instantiates the DB struct using the injected config

func (*DB) CreateCommand

func (db *DB) CreateCommand(command *Command) error

CreateCommand creates a Command entity and stores it in datastore

func (*DB) CreateEvent

func (db *DB) CreateEvent(event *Event) error

CreateEvent creates an Event entity and stores it in datastore

func (*DB) GetCommand

func (db *DB) GetCommand(id string) *Command

GetCommand gets a Command entity from datastore

func (*DB) GetEvent

func (db *DB) GetEvent(id string) *Event

GetEvent gets an Event entity from datastore GetCommand gets a Command entity from datastore

func (*DB) GetEventByCommandId

func (db *DB) GetEventByCommandId(id string) *Event

GetEvent gets an Event entity from datastore GetCommand gets a Command entity from datastore

func (*DB) Start

func (d *DB) Start() error

Start the DB component

func (*DB) Stop

func (d *DB) Stop(err error)

Stop the DB component

type Event

type Event struct {
	Id        *UUID             `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Action    string            `protobuf:"bytes,2,opt,name=action" json:"action,omitempty"`
	Data      string            `protobuf:"bytes,3,opt,name=data" json:"data,omitempty"`
	Timestamp int64             `protobuf:"varint,4,opt,name=timestamp" json:"timestamp,omitempty"`
	Topic     string            `protobuf:"bytes,5,opt,name=topic" json:"topic,omitempty"`
	Partition int32             `protobuf:"varint,6,opt,name=partition" json:"partition,omitempty"`
	Offset    int64             `protobuf:"varint,7,opt,name=offset" json:"offset,omitempty"`
	Parent    *UUID             `protobuf:"bytes,8,opt,name=parent" json:"parent,omitempty"`
	Carrier   map[string]string `` /* 134-byte string literal not displayed */
}

func (*Event) Descriptor

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

func (*Event) GetAction

func (m *Event) GetAction() string

func (*Event) GetCarrier

func (m *Event) GetCarrier() map[string]string

func (*Event) GetData

func (m *Event) GetData() string

func (*Event) GetId

func (m *Event) GetId() *UUID

func (*Event) GetOffset

func (m *Event) GetOffset() int64

func (*Event) GetParent

func (m *Event) GetParent() *UUID

func (*Event) GetPartition

func (m *Event) GetPartition() int32

func (*Event) GetTimestamp

func (m *Event) GetTimestamp() int64

func (*Event) GetTopic

func (m *Event) GetTopic() string

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) Reset

func (m *Event) Reset()

func (*Event) String

func (m *Event) String() string

type KindType

type KindType string

KindType represents a Kind for datastore

const (
	// KindTypeCommand for datastore
	KindTypeCommand KindType = "commands"

	// KindTypeEvent for datastore
	KindTypeEvent KindType = "events"
)

type PagedCommands

type PagedCommands struct {
	Limit    int64      `protobuf:"varint,1,opt,name=limit" json:"limit,omitempty"`
	Offset   int64      `protobuf:"varint,2,opt,name=offset" json:"offset,omitempty"`
	Total    int64      `protobuf:"varint,3,opt,name=total" json:"total,omitempty"`
	Commands []*Command `protobuf:"bytes,4,rep,name=commands" json:"commands,omitempty"`
}

func (*PagedCommands) Descriptor

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

func (*PagedCommands) GetCommands

func (m *PagedCommands) GetCommands() []*Command

func (*PagedCommands) GetLimit

func (m *PagedCommands) GetLimit() int64

func (*PagedCommands) GetOffset

func (m *PagedCommands) GetOffset() int64

func (*PagedCommands) GetTotal

func (m *PagedCommands) GetTotal() int64

func (*PagedCommands) ProtoMessage

func (*PagedCommands) ProtoMessage()

func (*PagedCommands) Reset

func (m *PagedCommands) Reset()

func (*PagedCommands) String

func (m *PagedCommands) String() string

type PagedEvents

type PagedEvents struct {
	Limit  int64    `protobuf:"varint,1,opt,name=limit" json:"limit,omitempty"`
	Offset int64    `protobuf:"varint,2,opt,name=offset" json:"offset,omitempty"`
	Total  int64    `protobuf:"varint,3,opt,name=total" json:"total,omitempty"`
	Events []*Event `protobuf:"bytes,4,rep,name=events" json:"events,omitempty"`
}

func (*PagedEvents) Descriptor

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

func (*PagedEvents) GetEvents

func (m *PagedEvents) GetEvents() []*Event

func (*PagedEvents) GetLimit

func (m *PagedEvents) GetLimit() int64

func (*PagedEvents) GetOffset

func (m *PagedEvents) GetOffset() int64

func (*PagedEvents) GetTotal

func (m *PagedEvents) GetTotal() int64

func (*PagedEvents) ProtoMessage

func (*PagedEvents) ProtoMessage()

func (*PagedEvents) Reset

func (m *PagedEvents) Reset()

func (*PagedEvents) String

func (m *PagedEvents) String() string

type PagingInfo

type PagingInfo struct {
	Limit  int64 `protobuf:"varint,1,opt,name=limit" json:"limit,omitempty"`
	Offset int64 `protobuf:"varint,2,opt,name=offset" json:"offset,omitempty"`
}

func (*PagingInfo) Descriptor

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

func (*PagingInfo) GetLimit

func (m *PagingInfo) GetLimit() int64

func (*PagingInfo) GetOffset

func (m *PagingInfo) GetOffset() int64

func (*PagingInfo) ProtoMessage

func (*PagingInfo) ProtoMessage()

func (*PagingInfo) Reset

func (m *PagingInfo) Reset()

func (*PagingInfo) String

func (m *PagingInfo) String() string

type StreamRequest

type StreamRequest struct {
}

func (*StreamRequest) Descriptor

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

func (*StreamRequest) ProtoMessage

func (*StreamRequest) ProtoMessage()

func (*StreamRequest) Reset

func (m *StreamRequest) Reset()

func (*StreamRequest) String

func (m *StreamRequest) String() string

type UUID

type UUID struct {
	Value string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
}

func (*UUID) Descriptor

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

func (*UUID) GetValue

func (m *UUID) GetValue() string

func (*UUID) ProtoMessage

func (*UUID) ProtoMessage()

func (*UUID) Reset

func (m *UUID) Reset()

func (*UUID) Scan

func (u *UUID) Scan(value interface{}) error

func (*UUID) String

func (m *UUID) String() string

Jump to

Keyboard shortcuts

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