Documentation ¶
Index ¶
- Variables
- type CreatePlanetCommand
- type CreatePlanetEvent
- type Deleter
- type Error
- type EventProcessor
- type EventType
- type EventsProcessor
- type Film
- type Films
- type HttpHandler
- type ID
- type KafkaRead
- type KafkaWriter
- type Metadata
- type PageFilterRequest
- type Pagination
- type PlanetDocument
- type ReadUpdater
- type Reader
- type StateResponse
- type Status
- type Updater
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnknown = Error{ Code: "PNT-001", Message: "There was an unknown error processing your request.", } ErrDecodeRequest = Error{ Code: "PNT-002", Message: "There was unable to decode your request.", } ErrPlanetIDEmpty = Error{ Code: "PNT-003", Message: "The PlanetID must not be empty.", } ErrPlanetAlreadyProcessed = Error{ Code: "PNT-004", Message: "The planet has already been processed.", } )
Functions ¶
This section is empty.
Types ¶
type CreatePlanetCommand ¶
type CreatePlanetCommand struct { Name string `json:"name"` Climate string `json:"climate"` Terrain string `json:"terrain"` }
func (*CreatePlanetCommand) Validate ¶
func (c *CreatePlanetCommand) Validate() map[string]string
type CreatePlanetEvent ¶
type EventProcessor ¶
type EventProcessor interface {
Process(data interface{}) error
}
type EventsProcessor ¶
type EventsProcessor map[string]EventProcessor
type HttpHandler ¶
type KafkaWriter ¶
type PageFilterRequest ¶
type PageFilterRequest struct { Name string `form:"name"` Page int `form:"page"` PerPage int `form:"per_page"` }
func (*PageFilterRequest) Validate ¶
func (p *PageFilterRequest) Validate() map[string]string
type Pagination ¶
type Pagination struct { Meta Metadata `json:"_metadata"` Results interface{} `json:"results"` }
type PlanetDocument ¶
type PlanetDocument struct { PlanetID ID `bson:"planetID" json:"planet_id"` Name string `bson:"name" json:"name"` Climate []string `bson:"climate" json:"climate"` Terrain []string `bson:"terrain" json:"terrain"` Films Films `bson:"films" json:"films"` Status string `bson:"status" json:"status"` mgm.IDField `bson:" ,inline" json:"-"` mgm.DateFields `bson:" ,inline"` }
type ReadUpdater ¶
type Reader ¶
type Reader interface { ReadByPlanetId(id ID) (PlanetDocument, error) ReadAll(filter PageFilterRequest) ([]PlanetDocument, error) Count() (int, error) }
type StateResponse ¶
type Updater ¶
type Updater interface {
Update(planet PlanetDocument) error
}
type Writer ¶
type Writer interface {
Write(createPlanet CreatePlanetCommand) (PlanetDocument, error)
}
Click to show internal directories.
Click to hide internal directories.