Documentation
¶
Index ¶
- type Client
- func (c *Client) Checker(ctx context.Context, check *health.CheckState) error
- func (c *Client) GetInteractives(ctx context.Context, userAuthToken, serviceAuthToken string, q *QueryParams) (m List, err error)
- func (c *Client) PutInteractive(ctx context.Context, userAuthToken, serviceAuthToken, interactiveID string, ...) error
- type ErrInvalidInteractivesAPIResponse
- type Interactive
- type InteractiveArchive
- type InteractiveFile
- type InteractiveMetadata
- type InteractiveUpdate
- type List
- type QueryParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a interactives api client which can be used to make requests to the server
func NewAPIClient ¶
NewAPIClient creates a new instance of Client with a given interactive api url and the relevant tokens
func NewAPIClientWithMaxRetries ¶
NewAPIClientWithMaxRetries creates a new instance of Client with a given interactive api url and the relevant tokens, setting a number of max retires for the HTTP client
func NewWithHealthClient ¶
func NewWithHealthClient(hcCli *healthcheck.Client) *Client
NewWithHealthClient creates a new instance of Client, reusing the URL and Clienter from the provided health check client.
func (*Client) Checker ¶
Checker calls interactives api health endpoint and returns a check object to the caller.
func (*Client) GetInteractives ¶
func (c *Client) GetInteractives(ctx context.Context, userAuthToken, serviceAuthToken string, q *QueryParams) (m List, err error)
GetInteractives returns the list of interactives
func (*Client) PutInteractive ¶
func (c *Client) PutInteractive(ctx context.Context, userAuthToken, serviceAuthToken, interactiveID string, update InteractiveUpdate) error
PutInteractive update the dataset
type ErrInvalidInteractivesAPIResponse ¶
type ErrInvalidInteractivesAPIResponse struct {
// contains filtered or unexported fields
}
ErrInvalidInteractivesAPIResponse is returned when the interactives api does not respond with a valid status
func NewInteractivesAPIResponse ¶
func NewInteractivesAPIResponse(resp *http.Response, uri string) (e *ErrInvalidInteractivesAPIResponse)
NewInteractivesAPIResponse creates an error response, optionally adding body to e when status is 404
func (ErrInvalidInteractivesAPIResponse) Error ¶
func (e ErrInvalidInteractivesAPIResponse) Error() string
type Interactive ¶
type Interactive struct {
ID string `json:"id,omitempty"`
Metadata *InteractiveMetadata `json:"metadata,omitempty"`
Archive *InteractiveArchive `json:"archive,omitempty"`
}
type InteractiveArchive ¶ added in v2.96.7
type InteractiveArchive struct {
Name string `json:"name,omitempty"`
Size int64 `json:"size_in_bytes,omitempty"`
Files []*InteractiveFile `json:"files,omitempty"`
}
type InteractiveFile ¶ added in v2.96.7
type InteractiveMetadata ¶ added in v2.96.8
type InteractiveMetadata struct {
Title string `json:"title"`
PrimaryTopic string `json:"primary_topic"`
Topics []string `json:"topics"`
Surveys []string `json:"surveys"`
ReleaseDate time.Time `json:"release_date"`
Uri string `json:"uri"`
Edition string `json:"edition,omitempty"`
Keywords []string `json:"keywords,omitempty"`
MetaDescription string `json:"meta_description,omitempty"`
Source string `json:"source,omitempty"`
Summary string `json:"summary,omitempty"`
}
type InteractiveUpdate ¶ added in v2.96.7
type InteractiveUpdate struct {
ImportSuccessful *bool `json:"import_successful,omitempty"`
ImportMessage string `json:"import_message,omitempty"`
Interactive Interactive `json:"interactive,omitempty"`
}
type List ¶
type List struct {
Items []Interactive `json:"items"`
Count int `json:"count"`
Offset int `json:"offset"`
Limit int `json:"limit"`
TotalCount int `json:"total_count"`
}
type QueryParams ¶
QueryParams represents the possible query parameters that a caller can provide
func (*QueryParams) Validate ¶
func (q *QueryParams) Validate() error