Documentation ¶
Index ¶
- Constants
- type Annotations
- type Contexts
- type Envelope
- type Event
- type JsonbEnvelope
- type OutputLocation
- type Payload
- type PayloadValidationError
- type SelfDescribingContext
- type SelfDescribingEvent
- type SelfDescribingPayload
- func (e SelfDescribingPayload) AsByte() ([]byte, error)
- func (e SelfDescribingPayload) AsMap() (map[string]interface{}, error)
- func (e SelfDescribingPayload) PayloadAsByte() ([]byte, error)
- func (e SelfDescribingPayload) Scan(input interface{}) error
- func (e SelfDescribingPayload) SchemaName() *string
- func (e SelfDescribingPayload) Value() (driver.Value, error)
- type StringEnvelope
- type Validation
- type ValidationError
Constants ¶
View Source
const ( PROTOCOL string = "protocol" VENDOR string = "vendor" NAMESPACE string = "namespace" VERSION string = "version" SCHEMA string = "schema" IS_VALID string = "isValid" )
View Source
const HTTP_HEADERS_CONTEXT string = "io.silverton/buz/internal/contexts/httpHeaders/v1.0.json"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contexts ¶ added in v0.13.0
type Contexts map[string]interface{}
func BuildContextsFromRequest ¶ added in v0.12.1
type Envelope ¶
type Envelope struct { Uuid uuid.UUID `json:"uuid"` Timestamp time.Time `json:"timestamp" sql:"index"` BuzTimestamp time.Time `json:"buzTimestamp" sql:"index"` BuzVersion string `json:"buzVersion"` BuzName string `json:"buzName"` BuzEnv string `json:"buzEnv"` Protocol string `json:"protocol"` Schema string `json:"schema"` Vendor string `json:"vendor"` Namespace string `json:"namespace"` Version string `json:"version"` IsValid bool `json:"isValid"` ValidationError *ValidationError `json:"validationError,omitempty" gorm:"type:json"` Contexts *Contexts `json:"contexts,omitempty" gorm:"type:json"` Payload Payload `json:"payload" gorm:"type:json"` }
An envelope consisting of minimally-defined properties
func NewEnvelope ¶ added in v0.14.0
Build a new envelope with base fields populated
func (*Envelope) OutputLocation ¶ added in v0.15.7
func (e *Envelope) OutputLocation() OutputLocation
type JsonbEnvelope ¶
type JsonbEnvelope struct { Uuid uuid.UUID `json:"uuid" gorm:"type:uuid"` Timestamp time.Time `json:"timestamp" sql:"index"` BuzTimestamp time.Time `json:"buzTimestamp" sql:"index"` BuzVersion string `json:"buzVersion"` BuzName string `json:"buzName"` BuzEnv string `json:"buzEnv"` Protocol string `json:"protocol"` Schema string `json:"schema"` Vendor string `json:"vendor"` Namespace string `json:"namespace"` Version string `json:"version"` IsValid bool `json:"isValid"` ValidationError *ValidationError `json:"validationError,omitempty" gorm:"type:jsonb"` Contexts *Contexts `json:"contexts,omitempty" gorm:"type:jsonb"` Payload Payload `json:"payload" gorm:"type:jsonb"` }
The only reason for this struct's existence is to properly create database tables with jsonb columns.
type OutputLocation ¶ added in v0.15.7
func NewOutputLocationFromEnvelope ¶ added in v0.15.7
func NewOutputLocationFromEnvelope(e *Envelope) OutputLocation
Build an OutputLocation using Envelope contents
type PayloadValidationError ¶
type SelfDescribingContext ¶ added in v0.13.0
type SelfDescribingContext SelfDescribingPayload
type SelfDescribingEvent ¶ added in v0.13.0
type SelfDescribingEvent struct { Contexts `json:"contexts"` Payload SelfDescribingPayload `json:"payload"` }
type SelfDescribingPayload ¶ added in v0.13.0
type SelfDescribingPayload struct { Schema string `json:"schema"` Data map[string]interface{} `json:"data"` }
func (SelfDescribingPayload) AsByte ¶ added in v0.13.0
func (e SelfDescribingPayload) AsByte() ([]byte, error)
func (SelfDescribingPayload) AsMap ¶ added in v0.13.0
func (e SelfDescribingPayload) AsMap() (map[string]interface{}, error)
func (SelfDescribingPayload) PayloadAsByte ¶ added in v0.13.0
func (e SelfDescribingPayload) PayloadAsByte() ([]byte, error)
func (SelfDescribingPayload) Scan ¶ added in v0.13.0
func (e SelfDescribingPayload) Scan(input interface{}) error
func (SelfDescribingPayload) SchemaName ¶ added in v0.13.0
func (e SelfDescribingPayload) SchemaName() *string
type StringEnvelope ¶
type StringEnvelope struct { Uuid uuid.UUID `json:"uuid" gorm:"type:uuid"` Timestamp time.Time `json:"timestamp" sql:"index"` BuzTimestamp time.Time `json:"buzTimestamp" sql:"index"` BuzVersion string `json:"buzVersion"` BuzName string `json:"buzName"` BuzEnv string `json:"buzEnv"` Protocol string `json:"protocol"` Schema string `json:"schema"` Vendor string `json:"vendor"` Namespace string `json:"namespace"` Version string `json:"version"` IsValid bool `json:"isValid"` ValidationError *ValidationError `json:"validationError,omitempty" gorm:"type:string"` Contexts *Contexts `json:"contexts,omitempty" gorm:"type:string"` Payload Payload `json:"payload" gorm:"type:string"` }
The only reason for this struct's existence is to properly create database tables with string columns.
type Validation ¶
type Validation struct { IsValid *bool `json:"isValid"` Error *ValidationError `json:"error,omitempty"` }
func (Validation) Scan ¶
func (e Validation) Scan(input interface{}) error
type ValidationError ¶
type ValidationError struct { ErrorType *string `json:"errorType,omitempty"` ErrorResolution *string `json:"errorResolution,omitempty"` Errors []PayloadValidationError `json:"payloadValidationErrors,omitempty"` }
func (*ValidationError) AsByte ¶ added in v0.17.0
func (e *ValidationError) AsByte() ([]byte, error)
func (*ValidationError) Scan ¶
func (e *ValidationError) Scan(input interface{}) error
Click to show internal directories.
Click to hide internal directories.