Documentation ¶
Overview ¶
ResourceLink provides a link for retrieving details for its resource types: https://github.com/openconnectivityfoundation/core/blob/OCF-v2.0.0/schemas/oic.oic-link-schema.json
Index ¶
- type BitMask
- type Endpoint
- type Endpoints
- type Policy
- type ResourceLink
- func (r ResourceLink) GetDeviceID() string
- func (r ResourceLink) GetEndpoints() Endpoints
- func (r ResourceLink) GetSecureEndpoints() Endpoints
- func (r ResourceLink) GetTCPAddr() (_ kitNet.Addr, err error)
- func (r ResourceLink) GetTCPSecureAddr() (_ kitNet.Addr, err error)
- func (r ResourceLink) GetUDPAddr() (_ kitNet.Addr, err error)
- func (r ResourceLink) GetUDPSecureAddr() (_ kitNet.Addr, err error)
- func (r ResourceLink) GetUnsecureEndpoints() Endpoints
- func (r ResourceLink) HasType(resourceType string) bool
- func (r ResourceLink) PatchEndpoint(addr kitNet.Addr, deviceEndpoints Endpoints) ResourceLink
- type ResourceLinks
- func (r ResourceLinks) GetResourceHrefs(resourceTypes ...string) []string
- func (r ResourceLinks) GetResourceLink(href string) (_ ResourceLink, ok bool)
- func (r ResourceLinks) GetResourceLinks(resourceTypes ...string) ResourceLinks
- func (r ResourceLinks) Len() int
- func (r ResourceLinks) Less(i, j int) bool
- func (r ResourceLinks) PatchEndpoint(addr kitNet.Addr, deviceEndpoints Endpoints) ResourceLinks
- func (r ResourceLinks) Sort() ResourceLinks
- func (r ResourceLinks) Swap(i, j int)
- type Scheme
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitMask ¶
type BitMask uint8
BitMask is defined with Policy on the line 1822 of the Core specification.
BitMask is defined with Policy on the line 1822 of the Core specification.
type Endpoint ¶
Endpoint is defined on the line 2439 and 1892, Priority on 2434 of the Core specification: - https://openconnectivity.org/specs/OCF_Core_Specification_v2.0.0.pdf - https://github.com/openconnectivityfoundation/core/blob/OCF-v2.0.0/schemas/oic.oic-link-schema.json When there are multiple endpoints, Priority indicates the priority among them. The lower the value, the higher the priority.
type Endpoints ¶
type Endpoints []Endpoint
func (Endpoints) FilterSecureEndpoints ¶
FilterSecureEndpoints returns secure endpoints in order of priority.
func (Endpoints) FilterUnsecureEndpoints ¶
FilterUnsecureEndpoints returns unsecure endpoints in order of priority.
type Policy ¶
type Policy struct { BitMask BitMask `json:"bm"` UDPPort uint16 `json:"port"` TCPPort uint16 `json:"x.org.iotivity.tcp"` TCPTLSPort uint16 `json:"x.org.iotivity.tls"` // Secured is true if the resource is only available via an encrypted connection. Secured bool `json:"sec"` }
Policy is defined on the line 1822 of the Core specification: https://openconnectivity.org/specs/OCF_Core_Specification_v2.0.0.pdf
type ResourceLink ¶
type ResourceLink struct { ID string `json:"id,omitempty"` Href string `json:"href"` ResourceTypes []string `json:"rt,omitempty"` Interfaces []string `json:"if,omitempty"` Policy *Policy `json:"p,omitempty"` Endpoints Endpoints `json:"eps,omitempty"` Anchor string `json:"anchor,omitempty"` DeviceID string `json:"di,omitempty"` InstanceID int64 `json:"ins,omitempty"` Title string `json:"title,omitempty"` SupportedContentTypes []string `json:"type,omitempty"` }
func (ResourceLink) GetDeviceID ¶
func (r ResourceLink) GetDeviceID() string
GetDeviceID returns device id.
func (ResourceLink) GetEndpoints ¶
func (r ResourceLink) GetEndpoints() Endpoints
GetEndpoints returns endpoints in order of priority.
func (ResourceLink) GetSecureEndpoints ¶
func (r ResourceLink) GetSecureEndpoints() Endpoints
func (ResourceLink) GetTCPAddr ¶
func (r ResourceLink) GetTCPAddr() (_ kitNet.Addr, err error)
GetTCPAddr parses and finds a TCP endpoint address.
func (ResourceLink) GetTCPSecureAddr ¶
func (r ResourceLink) GetTCPSecureAddr() (_ kitNet.Addr, err error)
GetTCPSecureAddr parses and finds a TCP secure endpoint address.
func (ResourceLink) GetUDPAddr ¶
func (r ResourceLink) GetUDPAddr() (_ kitNet.Addr, err error)
GetUDPAddr parses and finds a UDP endpoint address.
func (ResourceLink) GetUDPSecureAddr ¶
func (r ResourceLink) GetUDPSecureAddr() (_ kitNet.Addr, err error)
GetUDPSecureAddr parses and finds a UDP endpoint address.
func (ResourceLink) GetUnsecureEndpoints ¶
func (r ResourceLink) GetUnsecureEndpoints() Endpoints
func (ResourceLink) HasType ¶
func (r ResourceLink) HasType(resourceType string) bool
HasType checks the resource type.
func (ResourceLink) PatchEndpoint ¶
func (r ResourceLink) PatchEndpoint(addr kitNet.Addr, deviceEndpoints Endpoints) ResourceLink
PatchEndpoint adds Endpoint information where missing.
type ResourceLinks ¶
type ResourceLinks []ResourceLink
func (ResourceLinks) GetResourceHrefs ¶
func (r ResourceLinks) GetResourceHrefs(resourceTypes ...string) []string
GetResourceHrefs resolves URIs for a resource type.
func (ResourceLinks) GetResourceLink ¶
func (r ResourceLinks) GetResourceLink(href string) (_ ResourceLink, ok bool)
GetResourceLink finds a resource link with the same href.
func (ResourceLinks) GetResourceLinks ¶
func (r ResourceLinks) GetResourceLinks(resourceTypes ...string) ResourceLinks
GetResourceLinks resolves URIs for a resource type.
func (ResourceLinks) Len ¶
func (r ResourceLinks) Len() int
func (ResourceLinks) Less ¶
func (r ResourceLinks) Less(i, j int) bool
func (ResourceLinks) PatchEndpoint ¶
func (r ResourceLinks) PatchEndpoint(addr kitNet.Addr, deviceEndpoints Endpoints) ResourceLinks
PatchEndpoint adds Endpoint information where missing.
func (ResourceLinks) Sort ¶
func (r ResourceLinks) Sort() ResourceLinks
func (ResourceLinks) Swap ¶
func (r ResourceLinks) Swap(i, j int)
Directories ¶
Path | Synopsis |
---|---|
Package account implements the Account Token resource.
|
Package account implements the Account Token resource. |
Package acl implements the Access Control List resource.
|
Package acl implements the Access Control List resource. |
Auditable Event List https://github.com/openconnectivityfoundation/security/blob/master/swagger2.0/oic.sec.ael.swagger.json
|
Auditable Event List https://github.com/openconnectivityfoundation/security/blob/master/swagger2.0/oic.sec.ael.swagger.json |
Package cloud implements Cloud Configuration Resource.
|
Package cloud implements Cloud Configuration Resource. |
Collection https://github.com/openconnectivityfoundation/core/blob/master/swagger2.0/oic.wk.col.swagger.json
|
Collection https://github.com/openconnectivityfoundation/core/blob/master/swagger2.0/oic.wk.col.swagger.json |
Device Configuration https://github.com/openconnectivityfoundation/core-extensions/blob/master/swagger2.0/oic.wk.con.swagger.json
|
Device Configuration https://github.com/openconnectivityfoundation/core-extensions/blob/master/swagger2.0/oic.wk.con.swagger.json |
Credential https://github.com/openconnectivityfoundation/security/blob/master/swagger2.0/oic.sec.cred.swagger.json
|
Credential https://github.com/openconnectivityfoundation/security/blob/master/swagger2.0/oic.sec.cred.swagger.json |
Certificate Signing Request https://github.com/openconnectivityfoundation/security/blob/master/swagger2.0/oic.sec.csr.swagger.json
|
Certificate Signing Request https://github.com/openconnectivityfoundation/security/blob/master/swagger2.0/oic.sec.csr.swagger.json |
Device info.
|
Device info. |
Device Owner Transfer Method https://github.com/openconnectivityfoundation/security/blob/master/swagger2.0/oic.sec.doxm.swagger.json
|
Device Owner Transfer Method https://github.com/openconnectivityfoundation/security/blob/master/swagger2.0/oic.sec.doxm.swagger.json |
Introspection Resource https://github.com/openconnectivityfoundation/core/blob/master/swagger2.0/oic.wk.introspection.swagger.json
|
Introspection Resource https://github.com/openconnectivityfoundation/core/blob/master/swagger2.0/oic.wk.introspection.swagger.json |
Platform info https://github.com/openconnectivityfoundation/core/blob/master/swagger2.0/oic.wk.p.swagger.json
|
Platform info https://github.com/openconnectivityfoundation/core/blob/master/swagger2.0/oic.wk.p.swagger.json |
Package pstat implements Device Provisioning Status resource.
|
Package pstat implements Device Provisioning Status resource. |
Discoverable Resources https://github.com/openconnectivityfoundation/core/blob/master/swagger2.0/oic.wk.res.swagger.json
|
Discoverable Resources https://github.com/openconnectivityfoundation/core/blob/master/swagger2.0/oic.wk.res.swagger.json |
Asserted Roles https://github.com/openconnectivityfoundation/security/blob/master/swagger2.0/oic.sec.roles.swagger.json
|
Asserted Roles https://github.com/openconnectivityfoundation/security/blob/master/swagger2.0/oic.sec.roles.swagger.json |
Security Domain Information https://github.com/openconnectivityfoundation/security/blob/master/swagger2.0/oic.sec.sdi.swagger.json
|
Security Domain Information https://github.com/openconnectivityfoundation/security/blob/master/swagger2.0/oic.sec.sdi.swagger.json |
Session Resource that manages the persistent session between a Device and OCF Cloud.
|
Session Resource that manages the persistent session between a Device and OCF Cloud. |
Security Profile https://github.com/openconnectivityfoundation/security/blob/master/swagger2.0/oic.sec.sp.swagger.json
|
Security Profile https://github.com/openconnectivityfoundation/security/blob/master/swagger2.0/oic.sec.sp.swagger.json |