Documentation ¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- func FormatErrorMessage(status string, v interface{}) string
- func NewGenericOpenAPIError(error string) error
- func NewGenericOpenAPIErrorWithBody(error string, body []byte) error
- func NewGenericOpenAPIErrorWithBodyAndModel(error string, body []byte, model interface{}) error
- func ParameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, ...)
- func ParameterValueToString(obj interface{}, key string) string
- func ParameterValueToStringForType(obj interface{}, key string, objType string) string
- func ReportError(format string, a ...interface{}) error
- func SelectHeaderAccept(accepts []string) string
- func SelectHeaderContentType(contentTypes []string) string
- type APIClient
- func (c *APIClient) CallAPI(request *http.Request) (*http.Response, error)
- func (c *APIClient) Decode(v interface{}, b []byte, contentType string) (err error)
- func (c *APIClient) PrepareRequest(ctx context.Context, path string, method string, postBody interface{}, ...) (localVarRequest *http.Request, err error)
- type Configuration
- type FormFile
- type GenericOpenAPIError
- type MappedNullable
- type ServerConfiguration
- type ServerConfigurations
- type ServerVariable
- type Service
Constants ¶
This section is empty.
Variables ¶
var ( // ContextServerIndex uses a server configuration from the index. ContextServerIndex = contextKey("serverIndex") // ContextOperationServerIndices uses a server configuration from the index mapping. ContextOperationServerIndices = contextKey("serverOperationIndices") // ContextServerVariables overrides a server configuration variables. ContextServerVariables = contextKey("serverVariables") // ContextOperationServerVariables overrides a server configuration variables using operation specific values. ContextOperationServerVariables = contextKey("serverOperationVariables") )
Functions ¶
func CacheExpires ¶
CacheExpires helper function to determine remaining time before repeating a request.
func FormatErrorMessage ¶
format error message using title and detail when model implements rfc7807
func NewGenericOpenAPIError ¶
func ParameterAddToHeaderOrQuery ¶
func ParameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string)
ParameterAddToHeaderOrQuery adds the provided object to the request header or url query supporting deep object syntax
func ParameterValueToString ¶
func ReportError ¶
ReportError is to prevent trying to import "fmt"
func SelectHeaderAccept ¶
SelectHeaderAccept join all accept types and return
func SelectHeaderContentType ¶
SelectHeaderContentType select a content type from the available list.
Types ¶
type APIClient ¶
type APIClient struct { Cfg *Configuration Common Service // Reuse a single struct instead of allocating one for each service on the heap. }
APIClient manages communication with the API In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(basePath string, cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) PrepareRequest ¶
func (c *APIClient) PrepareRequest( ctx context.Context, path string, method string, postBody interface{}, headerParams map[string]string, queryParams url.Values, formParams url.Values, formFiles []FormFile) (localVarRequest *http.Request, err error)
PrepareRequest build the request
type Configuration ¶
type Configuration struct { ClientName string `json:"clientName,omitempty"` CSPURL string `json:"cspURL,omitempty"` APIKey string `json:"apiKey,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` Debug bool `json:"debug,omitempty"` Servers ServerConfigurations OperationServers map[string]ServerConfigurations HTTPClient *http.Client DefaultTags map[string]string }
Configuration stores the configuration of the API client
func NewConfiguration ¶
func NewConfiguration() *Configuration
NewConfiguration returns a new Configuration object. The following default values are set: - ClientName: "bloxone-go-client" - CSPURL: "https://csp.infoblox.com" - UserAgent: "bloxone-go-client/version" - Debug: false
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
AddDefaultHeader adds a new HTTP header to the default header in the request
func (*Configuration) ServerURLWithContext ¶
ServerURLWithContext returns a new server URL given an endpoint
type GenericOpenAPIError ¶
type GenericOpenAPIError struct {
// contains filtered or unexported fields
}
GenericOpenAPIError Provides access to the body, error and model on returned errors.
func (GenericOpenAPIError) Body ¶
func (e GenericOpenAPIError) Body() []byte
Body returns the raw bytes of the response
func (GenericOpenAPIError) Error ¶
func (e GenericOpenAPIError) Error() string
Error returns non-empty string if there was an error.
func (GenericOpenAPIError) Model ¶
func (e GenericOpenAPIError) Model() interface{}
Model returns the unpacked model of the error
type MappedNullable ¶
type ServerConfiguration ¶
type ServerConfiguration struct { URL string Description string Variables map[string]ServerVariable }
ServerConfiguration stores the information about a server
type ServerConfigurations ¶
type ServerConfigurations []ServerConfiguration
ServerConfigurations stores multiple ServerConfiguration items
type ServerVariable ¶
ServerVariable stores the information about a server variable