common

package
v0.0.0-...-83a686f Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	StatusCode int
	Body       Body
}

func (*ApiError) Error

func (a *ApiError) Error() string

type Body

type Body struct {
	// The error message
	Message string `json:"message" binding:"required" example:"Something went wrong :("`
}

Body models errors as JSON in the API

type Duration

type Duration time.Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() (b []byte, err error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) (err error)

type Headers

type Headers map[string]string

type Metadata

type Metadata struct {
	// When the data was created
	CreatedAt time.Time `json:"created_at" swaggertype:"string" format:"date-time"`
	// When the data was last modified
	ModifiedAt time.Time `json:"modified_at" swaggertype:"string" format:"date-time"`
	// Data versioning information
	Version Version `json:"version"`
}

Metadata holds information about the data it's embedded in

func FromDomainMetadata

func FromDomainMetadata(m *metadata.Metadata) Metadata

type Version

type Version struct {
	SeqNum      uint64 `json:"seq_num"`
	PrimaryTerm uint64 `json:"primary_term"`
}

Holds data that allows for optimistic locking

Jump to

Keyboard shortcuts

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