Documentation
¶
Index ¶
- Constants
- Variables
- func GetOpenAPISpec() ([]byte, error)
- func NewID() string
- func SendNotFound(w http.ResponseWriter, r *http.Request)
- func SendPanic(w http.ResponseWriter, r *http.Request)
- func SendUnauthorized(w http.ResponseWriter, r *http.Request, message string)
- type Error
- type Event
- type EventIndex
- type EventList
- type EventType
- type Meta
- type Metadata
- type PagingMeta
Constants ¶
View Source
const ErrorType = "Error"
ErrorType is the name of the type used to report errors.
Variables ¶
View Source
var BuildTime = "unknown"
BuildTime is the time when the binary was built, set at compile time via ldflags
View Source
var Version = "unknown"
Version is the application version set at compile time via ldflags
Functions ¶
func GetOpenAPISpec ¶
GetOpenAPISpec returns the embedded OpenAPI YAML file contents
func SendNotFound ¶
func SendNotFound(w http.ResponseWriter, r *http.Request)
SendNotFound sends a 404 response with some details about the non existing resource.
func SendPanic ¶
func SendPanic(w http.ResponseWriter, r *http.Request)
SendPanic sends a panic error response to the client, but it doesn't end the process.
func SendUnauthorized ¶
func SendUnauthorized(w http.ResponseWriter, r *http.Request, message string)
Types ¶
type Error ¶
type Error struct {
Type string `json:"type,omitempty"`
ID string `json:"id,omitempty"`
HREF string `json:"href,omitempty"`
Code string `json:"code,omitempty"`
Reason string `json:"reason,omitempty"`
}
Error represents an error reported by the API.
type Event ¶
type EventIndex ¶
type EventList ¶
type EventList []*Event
func (EventList) Index ¶
func (l EventList) Index() EventIndex
type Meta ¶
type Meta struct {
ID string
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
}
Meta is base model definition, embedded in all kinds
type Metadata ¶
type Metadata struct {
ID string `json:"id"`
HREF string `json:"href"`
Kind string `json:"kind"`
Version string `json:"version"`
BuildTime string `json:"build_time"`
}
Metadata api metadata.
type PagingMeta ¶
PagingMeta List Paging metadata
Source Files
¶
Click to show internal directories.
Click to hide internal directories.