Documentation
¶
Index ¶
- Constants
- Variables
- type ErrorMessages
- type Response
- func (d *Response) Container(container *container.Container) *Response
- func (d *Response) Containers(containers container.Containers) *Response
- func (d *Response) Field(field *field.Field) *Response
- func (d *Response) Fields(fields field.Fields) *Response
- func (d *Response) ID(id string) *Response
- func (d *Response) Message(message string) *Response
- func (d *Response) Object(o map[string]interface{}) *Response
- func (d *Response) Objects(o []map[string]interface{}) *Response
- func (d *Response) Token(token string) *Response
- func (d *Response) Value(value string) *Response
- type ResponseBuilder
Constants ¶
View Source
const (
BadRequest = "Bad request"
)
BadRequest invalid request
Variables ¶
View Source
var (
ErrBadRequest = errors.New(BadRequest)
)
ErrBadRequest invalid request error
Functions ¶
This section is empty.
Types ¶
type ErrorMessages ¶
type ErrorMessages struct {
JSONErrorMessage string `json:"message,omitempty"`
}
ErrorMessages contains error
func (*ErrorMessages) Message ¶
func (e *ErrorMessages) Message(message string) *ErrorMessages
Message #
type Response ¶
type Response struct {
JSONContainerID container.ID `json:"container_id,omitempty"`
JSONID string `json:"id,omitempty"`
JSONType string `json:"type,omitempty"`
JSONContainer *container.Container `json:"container,omitempty"`
JSONContainers container.Containers `json:"containers,omitempty"`
JSONValue string `json:"value,omitempty"`
JSONFields field.Fields `json:"fields,omitempty"`
JSONField *field.Field `json:"field,omitempty"`
JSONMessage string `json:"message,omitempty"`
JSONToken string `json:"token,omitempty"`
JSONObjects []map[string]interface{} `json:"objects,omitempty"`
JSONObject map[string]interface{} `json:"object,omitempty"`
}
Response contained requested info if request is successfull
func (*Response) Containers ¶
func (d *Response) Containers(containers container.Containers) *Response
Containers #
type ResponseBuilder ¶
type ResponseBuilder struct {
JSONData *Response `json:"data,omitempty"`
JSONErrors *ErrorMessages `json:"errors,omitempty"`
RawJSON map[string]interface{} `json:"data1,omitempty"`
}
ResponseBuilder is builder to create a api response
func (*ResponseBuilder) Error ¶
func (r *ResponseBuilder) Error() *ErrorMessages
Click to show internal directories.
Click to hide internal directories.