Documentation ¶
Index ¶
- func GetInstanceCredentials(config *Config, instanceName, userName string) (string, string, error)
- func GetSelfLinkFromHal(json []byte) string
- func StripTemplateParameter(templateURL string) string
- func UserRexOSDir() string
- type Config
- type Instance
- type RequestHandler
- type Session
- type Transformation
- type TransformationWithScale
- type User
- type Vec3f
- type Vec4f
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInstanceCredentials ¶
GetInstanceCredentials searches through the list of instances and returns the config where the defaultValue matches one of the instance with the given username (e.g. rex-production/user1) Returns clientID, clientSecret, error
func GetSelfLinkFromHal ¶
GetSelfLinkFromHal returns the stripped self link of a HAL resource. The input is the JSON response as string
func StripTemplateParameter ¶
StripTemplateParameter removes the trailing template parameters of an HATEOAS URL For example: "https://rex.robotic-eyes.com/rex-gateway/api/v2/rexReferences/1000/project{?projection}"
func UserRexOSDir ¶
func UserRexOSDir() string
UserRexOSDir is the local directory which should contain the config.yml file
Types ¶
type Config ¶
type Config struct { APIVersion string `yaml:"api-version"` Instances []Instance `yaml:"instances"` }
Config is the general config file
type Instance ¶
type Instance struct { Name string `yaml:"name"` URL string `yaml:"url"` Users []User `yaml:"users"` }
Instance defines one environment
type RequestHandler ¶
type RequestHandler interface { Authenticate(domain, id, secret string) Session AuthenticateWithSession(session Session) error Get(path string) (*resty.Response, error) GetFullyQualified(path string) (*resty.Response, error) Post(path string, body interface{}) (*resty.Response, error) Patch(path string, body interface{}) (*resty.Response, error) Delete(path string, body interface{}) (*resty.Response, error) PostMultipartFile(path string, fileName string, fileData io.Reader) (*resty.Response, error) }
RequestHandler interface
func NewRequestHandler ¶
func NewRequestHandler() RequestHandler
NewRequestHandler creates a new handler
type Session ¶
type Session struct { Domain string `json:"domain"` AccessToken string `json:"access_token"` TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` Scope string `json:"scope"` UserID string `json:"user_id"` UserName string `json:"user_name"` UserDisplayName string `json:"user_display_name"` Jti string `json:"jti"` Expires time.Time `json:"expires"` }
Session stores the information which gets retrieved after successful authentication. It also contains the token.
func NewSession ¶
NewSession creates a new session of the authentication response
func OpenSession ¶
OpenSession opens a session from a given file reader
func OpenStoredSession ¶
OpenStoredSession tries to open up a session file which got generated by a previous login operation
type Transformation ¶
type Transformation struct { Translation Vec3f `json:"translation"` // x/y/z Rotation Vec4f `json:"rotation"` // x/y/z/w }
Transformation is used for any transformation in the REXos system. It uses quaternions for rotation and only one scale value. Please do not use this struct directly, but use the NewTransformation() instead!
func NewTransformation ¶
func NewTransformation() Transformation
NewTransformation generates a valid transformation where W is set properly
type TransformationWithScale ¶
type TransformationWithScale struct { Transformation Scale float32 `json:"scale" example:"0.5"` // one scale for all axis }
TransformationWithScale takes a normal transformation and adds the scale value to it
func NewTransformationWithScale ¶
func NewTransformationWithScale() TransformationWithScale
NewTransformationWithScale generates a valid transformation where scale and W is set properly
type User ¶
type User struct { Name string `yaml:"name"` ClientID string `yaml:"client-id"` ClientSecret string `yaml:"client-secret"` }
User defines a user login
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package admin provides ...
|
Package admin provides ... |
Package creation provides ...
|
Package creation provides ... |
Package detection provides ...
|
Package detection provides ... |