base

package
v0.0.1-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2016 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorDeliveryTypeInvalid

func ErrorDeliveryTypeInvalid(invalidDeliveryType string) *service.Error

func ErrorSubTypeInvalid

func ErrorSubTypeInvalid(invalidSubType string) *service.Error

func ErrorTypeInvalid

func ErrorTypeInvalid(invalidType string) *service.Error

func ErrorValueMissing

func ErrorValueMissing() *service.Error

Types

type Base

type Base struct {
	Active        bool   `json:"-" bson:"_active"`                                   // SET
	CreatedTime   string `json:"createdTime,omitempty" bson:"createdTime,omitempty"` // SET
	GroupID       string `json:"-" bson:"_groupId,omitempty"`                        // SET
	ID            string `json:"id,omitempty" bson:"id,omitempty"`                   // SET - old deduplication id???
	SchemaVersion int    `json:"-" bson:"_schemaVersion,omitempty"`                  // SET
	Type          string `json:"type,omitempty" bson:"type,omitempty"`               // SET (AFTER PARSE)
	UploadID      string `json:"uploadId,omitempty" bson:"uploadId,omitempty"`       // SET
	UserID        string `json:"userId,omitempty" bson:"userId,omitempty"`           // SET		// TODO: Should this be _userId in bson?, Should it be returned in JSON?

	Annotations      *[]interface{} `json:"annotations,omitempty" bson:"annotations,omitempty"`           // PARSE
	ClockDriftOffset *int           `json:"clockDriftOffset,omitempty" bson:"clockDriftOffset,omitempty"` // PARSE
	ConversionOffset *int           `json:"conversionOffset,omitempty" bson:"conversionOffset,omitempty"` // PARSE
	DeviceID         *string        `json:"deviceId,omitempty" bson:"deviceId,omitempty"`                 // PARSE
	DeviceTime       *string        `json:"deviceTime,omitempty" bson:"deviceTime,omitempty"`             // PARSE
	Payload          *interface{}   `json:"payload,omitempty" bson:"payload,omitempty"`                   // PARSE
	Time             *string        `json:"time,omitempty" bson:"time,omitempty"`                         // PARSE
	TimezoneOffset   *int           `json:"timezoneOffset,omitempty" bson:"timezoneOffset,omitempty"`     // PARSE
	Version          *int           `json:"-" bson:"_version,omitempty"`                                  // SET
}

func New

func New(Type string) (*Base, error)

func (*Base) Meta

func (b *Base) Meta() interface{}

func (*Base) Normalize

func (b *Base) Normalize(normalizer data.Normalizer) error

func (*Base) Parse

func (b *Base) Parse(parser data.ObjectParser) error

func (*Base) SetDatasetID

func (b *Base) SetDatasetID(datasetID string)

func (*Base) SetGroupID

func (b *Base) SetGroupID(groupID string)

func (*Base) SetUserID

func (b *Base) SetUserID(userID string)

func (*Base) Validate

func (b *Base) Validate(validator data.Validator) error

type Meta

type Meta struct {
	Type string `json:"type,omitempty"`
}

Jump to

Keyboard shortcuts

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