Documentation
¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type BasicAuth
- type Configuration
- type Error
- type FindObjectsOpts
- type GenericOpenAPIError
- type InstanceType
- type Item
- type Lwm2M
- type MandatoryType
- type Object
- type ObjectApiService
- type ObjectMeta
- type ObjectResources
- type ObjectsApiService
- type OperationType
- type Resource
- type ServerConfiguration
- type ServerVariable
- type Type
Constants ¶
This section is empty.
Variables ¶
var ( // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct {
ObjectApi *ObjectApiService
ObjectsApi *ObjectsApiService
// contains filtered or unexported fields
}
APIClient manages communication with the IPSO Registry API v1.0.0 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(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) ChangeBasePath ¶
ChangeBasePath changes base path to allow switching to mocks
func (*APIClient) GetConfig ¶
func (c *APIClient) GetConfig() *Configuration
Allow modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶
type APIResponse struct {
*http.Response `json:"-"`
Message string `json:"message,omitempty"`
// Operation is the name of the OpenAPI operation.
Operation string `json:"operation,omitempty"`
// RequestURL is the request URL. This value is always available, even if the
// embedded *http.Response is nil.
RequestURL string `json:"url,omitempty"`
// Method is the HTTP method used for the request. This value is always
// available, even if the embedded *http.Response is nil.
Method string `json:"method,omitempty"`
// Payload holds the contents of the response body (which may be nil or empty).
// This is provided here as the raw response.Body() reader will have already
// been drained.
Payload []byte `json:"-"`
}
APIResponse stores the API response returned by the server.
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
NewAPIResponse returns a new APIResonse object.
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
type BasicAuth ¶
type BasicAuth struct {
UserName string `json:"userName,omitempty"`
Password string `json:"password,omitempty"`
}
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type Configuration ¶
type Configuration struct {
BasePath string `json:"basePath,omitempty"`
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
Debug bool `json:"debug,omitempty"`
Servers []ServerConfiguration
HTTPClient *http.Client
}
Configuration stores the configuration of the API client
func NewConfiguration ¶
func NewConfiguration() *Configuration
NewConfiguration returns a new Configuration object
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
AddDefaultHeader adds a new HTTP header to the default header in the request
type Error ¶
type Error struct {
Code int32 `json:"code" xml:"code"`
Message string `json:"message" xml:"message"`
}
Error struct for Error
type FindObjectsOpts ¶
FindObjectsOpts Optional parameters for the method 'FindObjects'
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 InstanceType ¶
type InstanceType string
InstanceType the model 'InstanceType'
const ( MULTIPLE InstanceType = "Multiple" SINGLE InstanceType = "Single" )
List of InstanceType
type Item ¶
type Item struct {
Name string `json:"Name,omitempty"`
Operations OperationType `json:"Operations,omitempty"`
MultipleInstances InstanceType `json:"MultipleInstances,omitempty"`
Mandatory MandatoryType `json:"Mandatory,omitempty"`
Type Type `json:"Type,omitempty"`
RangeEnumeration string `json:"RangeEnumeration,omitempty"`
Units string `json:"Units,omitempty"`
Description string `json:"Description,omitempty"`
}
Item struct for Item
type Lwm2M ¶
type Lwm2M struct {
Object Object `json:"Object,omitempty" xml:"Object"`
}
Lwm2M struct for Lwm2M
type MandatoryType ¶
type MandatoryType string
MandatoryType the model 'MandatoryType'
const ( MANDATORY MandatoryType = "Mandatory" OPTIONAL MandatoryType = "Optional" )
List of MandatoryType
type Object ¶
type Object struct {
Name string `json:"Name" xml:"Name"`
Description1 string `json:"Description1,omitempty" xml:"Description1"`
Description2 string `json:"Description2,omitempty" xml:"Description2"`
ObjectID int32 `json:"ObjectID" xml:"ObjectID"`
ObjectURN string `json:"ObjectURN,omitempty" xml:"ObjectURN"`
LWM2MVersion string `json:"LWM2MVersion,omitempty" xml:"LWM2MVersion"`
ObjectVersion string `json:"ObjectVersion,omitempty" xml:"ObjectVersion"`
MultipleInstances InstanceType `json:"MultipleInstances" xml:"MultipleInstances"`
Mandatory MandatoryType `json:"Mandatory" xml:"Mandatory"`
Resources ObjectResources `json:"Resources" xml:"Resources"`
}
Object struct for Object
type ObjectApiService ¶
type ObjectApiService service
ObjectApiService ObjectApi service
func (*ObjectApiService) FindObject ¶
func (a *ObjectApiService) FindObject(ctx _context.Context, objectURI string) (Lwm2M, *_nethttp.Response, error)
FindObject Method for FindObject get details of a single object
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param objectURI version of object to retrieve
@return Lwm2M
type ObjectMeta ¶
type ObjectMeta struct {
ObjectID int32 `json:"ObjectID" xml:"ObjectID"`
Ver string `json:"Ver,omitempty" xml:"Ver"`
URN string `json:"URN,omitempty" xml:"URN"`
Name string `json:"Name" xml:"Name"`
Description string `json:"Description,omitempty" xml:"Description"`
Owner string `json:"Owner,omitempty" xml:"Owner"`
Label string `json:"Label,omitempty" xml:"Label"`
ObjectLink string `json:"ObjectLink" xml:"ObjectLink"`
ObjectLinkVisible string `json:"ObjectLinkVisible,omitempty" xml:"ObjectLinkVisible"`
SpecLink string `json:"SpecLink,omitempty" xml:"SpecLink"`
SpecLinkVisible string `json:"SpecLinkVisible,omitempty" xml:"SpecLinkVisible"`
VortoLink string `json:"VortoLink,omitempty" xml:"VortoLink"`
}
ObjectMeta struct for ObjectMeta
type ObjectResources ¶
type ObjectResources struct {
Item []Resource `json:"Item,omitempty" xml:"Item"`
}
ObjectResources struct for ObjectResources
type ObjectsApiService ¶
type ObjectsApiService service
ObjectsApiService ObjectsApi service
func (*ObjectsApiService) FindObjects ¶
func (a *ObjectsApiService) FindObjects(ctx _context.Context, localVarOptionals *FindObjectsOpts) ([]ObjectMeta, *_nethttp.Response, error)
FindObjects Method for FindObjects Returns metadata of of objects. Can be filtered by object ID and version
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param optional nil or *FindObjectsOpts - Optional Parameters:
- @param "ObjectVersion" (optional.String) - version of object to retrieve
- @param "ObjectID" (optional.Int32) - ID of object to retrieve
@return []ObjectMeta
type OperationType ¶
type OperationType string
OperationType the model 'OperationType'
const ( R OperationType = "R" W OperationType = "W" RW OperationType = "RW" E OperationType = "E" )
List of OperationType
type Resource ¶
type Resource struct {
ID int32 `json:"ID" xml:"ID,attr"`
Name string `json:"Name" xml:"Name"`
Operations OperationType `json:"Operations" xml:"Operations"`
MultipleInstances InstanceType `json:"MultipleInstances" xml:"MultipleInstances"`
Mandatory MandatoryType `json:"Mandatory" xml:"Mandatory"`
Type Type `json:"Type" xml:"Type"`
RangeEnumeration string `json:"RangeEnumeration,omitempty" xml:"RangeEnumeration"`
Units string `json:"Units,omitempty" xml:"Units"`
Description string `json:"Description,omitempty" xml:"Description"`
}
Resource struct for Resource
type ServerConfiguration ¶
type ServerConfiguration struct {
Url string
Description string
Variables map[string]ServerVariable
}
ServerConfiguration stores the information about a server
type ServerVariable ¶
ServerVariable stores the information about a server variable