sdk

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BundlesList

type BundlesList struct {
	Items      []models.Bundle `json:"items"`
	Count      int             `json:"count"`
	Offset     int             `json:"offset"`
	Limit      int             `json:"limit"`
	TotalCount int             `json:"total_count"`
}

BundlesList represents an object containing a list of paginated bundles. This struct is based on the `pagination.page` struct which is returned when we call the `api.getBundles` endpoint

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(bundleAPIURL string) *Client

New creates a new instance of Client with a given bundle api url

func NewWithHealthClient

func NewWithHealthClient(hcCli *healthcheck.Client) *Client

NewWithHealthClient creates a new instance of bundle API Client, reusing the URL and Clienter from the provided healthcheck client

func (*Client) Checker

func (cli *Client) Checker(ctx context.Context, check *health.CheckState) error

Checker calls identity api health endpoint and returns a check object to the caller

func (*Client) GetBundle

func (cli *Client) GetBundle(ctx context.Context, headers Headers, id string) (*ResponseInfo, apiError.Error)

func (*Client) GetBundles

func (cli *Client) GetBundles(ctx context.Context, headers Headers, scheduledAt *time.Time, queryParams *QueryParams) (*BundlesList, apiError.Error)

GetBundles gets a list of bundles

func (*Client) Health

func (cli *Client) Health() *healthcheck.Client

Health returns the underlying Healthcheck Client for this bundle API client

func (*Client) PutBundleState

func (cli *Client) PutBundleState(ctx context.Context, headers Headers, id string, state models.BundleState) (*models.Bundle, apiError.Error)

func (*Client) URL

func (cli *Client) URL() string

URL returns the URL used by this client

type Headers

type Headers struct {
	ServiceAuthToken string
	UserAccessToken  string
	IfMatch          string
}

func (*Headers) Add

func (h *Headers) Add(req *http.Request)

type QueryParams

type QueryParams struct {
	Limit  int
	Offset int
}

QueryParams represents the possible query parameters that a caller can provide

func (*QueryParams) Validate

func (q *QueryParams) Validate() error

Validate validates tht no negative values are provided for limit or offset, and that the length of IDs is lower than the maximum

type ResponseInfo

type ResponseInfo struct {
	Body    []byte
	Headers http.Header
	Status  int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL