Documentation ¶
Index ¶
- type AutoIncrementingModel
- type CRUD
- type Client
- func (c *Client) Delete(uri string) (status int, response interface{}, err error)
- func (c *Client) DeleteWithTLSClientConfig(uri string, tlsClientConfig *tls.Config) (status int, response interface{}, err error)
- func (c *Client) Get(uri string, params map[string]interface{}) (status int, response interface{}, err error)
- func (c *Client) GetWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)
- func (c *Client) Head(uri string, params map[string]interface{}) (status int, response map[string][]string, err error)
- func (c *Client) Patch(uri string, params map[string]interface{}) (status int, response interface{}, err error)
- func (c *Client) PatchWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)
- func (c *Client) Post(uri string, params map[string]interface{}) (status int, response interface{}, err error)
- func (c *Client) PostMultipartFormData(uri string, params map[string]interface{}) (status int, response interface{}, err error)
- func (c *Client) PostMultipartFormDataWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)
- func (c *Client) PostWWWFormURLEncoded(uri string, params map[string]interface{}) (status int, response interface{}, err error)
- func (c *Client) PostWWWFormURLEncodedWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)
- func (c *Client) PostWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)
- func (c *Client) Put(uri string, params map[string]interface{}) (status int, response interface{}, err error)
- func (c *Client) PutWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)
- type Error
- type Manifest
- type ManifestPackage
- type Model
- type ModelWithDID
- type RequestResponseContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoIncrementingModel ¶
type AutoIncrementingModel struct { ID uint `gorm:"primary_key;column:id;default:nextval('accounts_id_seq'::regclass)" json:"id"` CreatedAt time.Time `sql:"not null;default:now()" json:"created_at,omitempty"` Errors []*Error `sql:"-" json:"errors,omitempty"` }
AutoIncrementingModel base class with int primary key
type CRUD ¶
type CRUD interface { Create(tx *gorm.DB) bool Delete(tx *gorm.DB) bool Reload() Update(tx *gorm.DB) bool Validate() bool }
CRUD interface
type Client ¶
type Client struct { Host string Path string Scheme string Cookie *string Headers map[string][]string Token *string Username *string Password *string }
Client is a generic base class for calling a REST API; when a token is configured on an Client instance it will be provided as a bearer authorization header; when a username and password are configured on an Client instance, they will be used for HTTP basic authorization but will be passed as the Authorization header instead of as part of the URL itself. When a token is configured on an Client instance, the username and password supplied for basic auth are currently discarded.
func (*Client) DeleteWithTLSClientConfig ¶
func (c *Client) DeleteWithTLSClientConfig(uri string, tlsClientConfig *tls.Config) (status int, response interface{}, err error)
DeleteWithTLSClientConfig constructs and synchronously sends an API DELETE request
func (*Client) Get ¶
func (c *Client) Get(uri string, params map[string]interface{}) (status int, response interface{}, err error)
Get constructs and synchronously sends an API GET request
func (*Client) GetWithTLSClientConfig ¶
func (c *Client) GetWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)
GetWithTLSClientConfig constructs and synchronously sends an API GET request
func (*Client) Head ¶
func (c *Client) Head(uri string, params map[string]interface{}) (status int, response map[string][]string, err error)
Head constructs and synchronously sends an API HEAD request; returns the headers
func (*Client) Patch ¶
func (c *Client) Patch(uri string, params map[string]interface{}) (status int, response interface{}, err error)
Patch constructs and synchronously sends an API PATCH request
func (*Client) PatchWithTLSClientConfig ¶
func (c *Client) PatchWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)
PatchWithTLSClientConfig constructs and synchronously sends an API PATCH request
func (*Client) Post ¶
func (c *Client) Post(uri string, params map[string]interface{}) (status int, response interface{}, err error)
Post constructs and synchronously sends an API POST request
func (*Client) PostMultipartFormData ¶
func (c *Client) PostMultipartFormData(uri string, params map[string]interface{}) (status int, response interface{}, err error)
PostMultipartFormData constructs and synchronously sends an API POST request using multipart/form-data as the content-type
func (*Client) PostMultipartFormDataWithTLSClientConfig ¶
func (c *Client) PostMultipartFormDataWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)
PostMultipartFormDataWithTLSClientConfig constructs and synchronously sends an API POST request using multipart/form-data as the content-type
func (*Client) PostWWWFormURLEncoded ¶
func (c *Client) PostWWWFormURLEncoded(uri string, params map[string]interface{}) (status int, response interface{}, err error)
PostWWWFormURLEncoded constructs and synchronously sends an API POST request using application/x-www-form-urlencoded as the content-type
func (*Client) PostWWWFormURLEncodedWithTLSClientConfig ¶
func (c *Client) PostWWWFormURLEncodedWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)
PostWWWFormURLEncodedWithTLSClientConfig constructs and synchronously sends an API POST request using application/x-www-form-urlencoded as the content-type
func (*Client) PostWithTLSClientConfig ¶
func (c *Client) PostWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)
PostWithTLSClientConfig constructs and synchronously sends an API POST request
type Manifest ¶
type Manifest struct { Name string `json:"name"` Version string `json:"version"` Repository string `json:"repository"` Packages []*ManifestPackage `json:"packages"` }
Manifest defines the contents of a Provide release
type ManifestPackage ¶
type ManifestPackage struct { Name string `json:"name"` Version string `json:"version"` Source string `json:"source"` Image string `json:"docker_image"` Type string `json:"type"` }
ManifestPackage defines a single Manifest package
type Model ¶
type Model struct { ID uuid.UUID `sql:"primary_key;type:uuid;default:uuid_generate_v4()" json:"id"` CreatedAt time.Time `sql:"not null;default:now()" json:"created_at,omitempty"` Errors []*Error `sql:"-" json:"errors,omitempty"` }
Model base class with uuid v4 primary key
type ModelWithDID ¶
type ModelWithDID struct { ID *string `sql:"primary_key" json:"id"` CreatedAt time.Time `sql:"not null;default:now()" json:"created_at,omitempty"` Errors []*Error `sql:"-" json:"errors,omitempty"` }
ModelWithDID base class with string-based primary key for DID support
type RequestResponseContext ¶
type RequestResponseContext interface { Flush() Get(key string) (value interface{}, exists bool) GetRawData() ([]byte, error) Header(key, value string) Param(key string) string Query(key string) string Status() int Size() int Write([]byte) (int, error) WriteHeader(statusCode int) WriteHeaderNow() WriteString(string) (int, error) }
RequestResponseContext