Documentation
¶
Overview ¶
Package api provides methods to access the XTP API.
Index ¶
Constants ¶
View Source
const ( AuthHeader = "Authorization" ContentTypeHeader = "Content-Type" ContentType = "application/json; charset=utf-8" XTPTokenEnvVar = "XTP_TOKEN" )
Variables ¶
View Source
var (
ErrXTPTokenEnvVarNotSet = errors.New("env var XTP_TOKEN not set")
)
Functions ¶
This section is empty.
Types ¶
type AppsExtensionPointsResponse ¶
type AppsExtensionPointsResponse struct { ExtensionPoints []*ExtensionPoint `json:"objects"` Next *string `json:"next,omitempty"` Prev *string `json:"prev,omitempty"` Total int `json:"total"` PerPage int `json:"perPage"` }
AppsExtensionPointsResponse represents the response from the /apps endpoint.
func (*AppsExtensionPointsResponse) String ¶
func (r *AppsExtensionPointsResponse) String() string
type Binding ¶
type Binding struct { ID string `json:"id"` ContentAddress string `json:"contentAddress"` UpdatedAt string `json:"updatedAt"` }
Binding represents an XTP Extension Point Binding.
type BindingsMap ¶
BindingsMap represents a collection of bindings keyed by name.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an XTP API client.
func (*Client) GetAppsExtensionPoints ¶
func (c *Client) GetAppsExtensionPoints(appID string) (*AppsExtensionPointsResponse, error)
GetAppsExtensionPoints returns extension points for the provided App ID.
func (*Client) GetContent ¶
GetContent gets the content at the provided address.
func (*Client) GetExtensionPointBindings ¶
func (c *Client) GetExtensionPointBindings(ep *ExtensionPoint) (BindingsMap, error)
GetExtensionPointBindings returns extension points for the provided App ID.
type ExtensionPoint ¶
type ExtensionPoint struct { ID string `json:"id"` // "pattern": "^usr_[a-z0-9]{26}$" Name string `json:"name,omitempty"` AppID string `json:"appId,omitempty"` // "pattern": "^app_[a-z0-9]{26}$" // Schema *Schema `json:"schema,omitempty"` // TODO SchemaYaml string `json:"schemaYaml,omitempty"` CreatedAt string `json:"createdAt,omitempty"` // e.g. "2024-06-26T19:58:22.674Z" UpdatedAt string `json:"updatedAt,omitempty"` // e.g. "2024-06-26T19:58:22.674Z" }
ExtensionPoint represents an extension point associated with an app.
func (*ExtensionPoint) String ¶
func (e *ExtensionPoint) String() string
Click to show internal directories.
Click to hide internal directories.