Documentation ¶
Index ¶
- Constants
- Variables
- func IsNotFound(err error) bool
- func NewListOpts() *types.ListOpts
- type APIBaseClient
- func (a *APIBaseClient) Action(schemaType string, action string, existing *types.Resource, ...) error
- func (a *APIBaseClient) ByID(schemaType string, id string, respObject interface{}) error
- func (a *APIBaseClient) Create(schemaType string, createObj interface{}, respObject interface{}) error
- func (a *APIBaseClient) Delete(existing *types.Resource) error
- func (a *APIBaseClient) GetLink(resource types.Resource, link string, respObject interface{}) error
- func (a *APIBaseClient) List(schemaType string, opts *types.ListOpts, respObject interface{}) error
- func (a *APIBaseClient) Post(url string, createObj interface{}, respObject interface{}) error
- func (a *APIBaseClient) Reload(existing *types.Resource, output interface{}) error
- func (a *APIBaseClient) Replace(schemaType string, existing *types.Resource, updates interface{}, ...) error
- func (a *APIBaseClient) Update(schemaType string, existing *types.Resource, updates interface{}, ...) error
- func (a *APIBaseClient) Websocket(url string, headers map[string][]string) (*websocket.Conn, *http.Response, error)
- type APIBaseClientInterface
- type APIError
- type APIOperations
- func (a *APIOperations) DoAction(schemaType string, action string, existing *types.Resource, ...) error
- func (a *APIOperations) DoByID(schemaType string, id string, respObject interface{}) error
- func (a *APIOperations) DoCollectionAction(schemaType string, action string, existing *types.Collection, ...) error
- func (a *APIOperations) DoCreate(schemaType string, createObj interface{}, respObject interface{}) error
- func (a *APIOperations) DoDelete(url string) error
- func (a *APIOperations) DoGet(url string, opts *types.ListOpts, respObject interface{}) error
- func (a *APIOperations) DoList(schemaType string, opts *types.ListOpts, respObject interface{}) error
- func (a *APIOperations) DoModify(method string, url string, createObj interface{}, respObject interface{}) error
- func (a *APIOperations) DoNext(nextURL string, respObject interface{}) error
- func (a *APIOperations) DoReplace(schemaType string, existing *types.Resource, updates interface{}, ...) error
- func (a *APIOperations) DoResourceDelete(schemaType string, existing *types.Resource) error
- func (a *APIOperations) DoUpdate(schemaType string, existing *types.Resource, updates interface{}, ...) error
- func (a *APIOperations) SetupRequest(req *http.Request)
- type ClientOpts
Constants ¶
View Source
const ( SELF = "self" COLLECTION = "collection" )
Variables ¶
View Source
var (
Debug = false
)
Functions ¶
func IsNotFound ¶
func NewListOpts ¶
Types ¶
type APIBaseClient ¶
type APIBaseClient struct { Ops *APIOperations Opts *ClientOpts Types map[string]types.Schema }
func NewAPIClient ¶
func NewAPIClient(opts *ClientOpts) (APIBaseClient, error)
func (*APIBaseClient) ByID ¶
func (a *APIBaseClient) ByID(schemaType string, id string, respObject interface{}) error
func (*APIBaseClient) Create ¶
func (a *APIBaseClient) Create(schemaType string, createObj interface{}, respObject interface{}) error
func (*APIBaseClient) GetLink ¶
func (a *APIBaseClient) GetLink(resource types.Resource, link string, respObject interface{}) error
func (*APIBaseClient) List ¶
func (a *APIBaseClient) List(schemaType string, opts *types.ListOpts, respObject interface{}) error
func (*APIBaseClient) Post ¶
func (a *APIBaseClient) Post(url string, createObj interface{}, respObject interface{}) error
func (*APIBaseClient) Reload ¶
func (a *APIBaseClient) Reload(existing *types.Resource, output interface{}) error
func (*APIBaseClient) Replace ¶
func (a *APIBaseClient) Replace(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error
type APIBaseClientInterface ¶
type APIBaseClientInterface interface { Websocket(url string, headers map[string][]string) (*websocket.Conn, *http.Response, error) List(schemaType string, opts *types.ListOpts, respObject interface{}) error Post(url string, createObj interface{}, respObject interface{}) error GetLink(resource types.Resource, link string, respObject interface{}) error Create(schemaType string, createObj interface{}, respObject interface{}) error Update(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error Replace(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error ByID(schemaType string, id string, respObject interface{}) error Delete(existing *types.Resource) error Reload(existing *types.Resource, output interface{}) error Action(schemaType string, action string, existing *types.Resource, inputObject, respObject interface{}) error }
type APIOperations ¶
type APIOperations struct { Opts *ClientOpts Types map[string]types.Schema Client *http.Client Dialer *websocket.Dialer }
func (*APIOperations) DoByID ¶
func (a *APIOperations) DoByID(schemaType string, id string, respObject interface{}) error
func (*APIOperations) DoCollectionAction ¶
func (a *APIOperations) DoCollectionAction(schemaType string, action string, existing *types.Collection, inputObject, respObject interface{}) error
func (*APIOperations) DoCreate ¶
func (a *APIOperations) DoCreate(schemaType string, createObj interface{}, respObject interface{}) error
func (*APIOperations) DoDelete ¶
func (a *APIOperations) DoDelete(url string) error
func (*APIOperations) DoGet ¶
func (a *APIOperations) DoGet(url string, opts *types.ListOpts, respObject interface{}) error
func (*APIOperations) DoList ¶
func (a *APIOperations) DoList(schemaType string, opts *types.ListOpts, respObject interface{}) error
func (*APIOperations) DoModify ¶
func (a *APIOperations) DoModify(method string, url string, createObj interface{}, respObject interface{}) error
func (*APIOperations) DoNext ¶
func (a *APIOperations) DoNext(nextURL string, respObject interface{}) error
func (*APIOperations) DoReplace ¶
func (a *APIOperations) DoReplace(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error
func (*APIOperations) DoResourceDelete ¶
func (a *APIOperations) DoResourceDelete(schemaType string, existing *types.Resource) error
func (*APIOperations) DoUpdate ¶
func (a *APIOperations) DoUpdate(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error
func (*APIOperations) SetupRequest ¶
func (a *APIOperations) SetupRequest(req *http.Request)
Click to show internal directories.
Click to hide internal directories.