clients

package
v0.4.17 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserAgent string

Functions

func CatalystHookPath added in v0.4.17

func CatalystHookPath(apiRoot, taskId string) string

Types

type BaseClient

type BaseClient struct {
	*http.Client
	BaseUrl     string
	BaseHeaders map[string]string
}

func (*BaseClient) DoRequest

func (c *BaseClient) DoRequest(ctx context.Context, r Request, output interface{}) error

type Catalyst added in v0.4.17

type Catalyst interface {
	UploadVOD(ctx context.Context, upload UploadVODRequest) error
	CatalystHookURL(taskId, nextStep string) (string, error)
}

func NewCatalyst added in v0.4.17

func NewCatalyst(opts CatalystOptions) Catalyst

type CatalystCallback added in v0.4.17

type CatalystCallback struct {
	Status          string         `json:"status"`
	CompletionRatio float64        `json:"completion_ratio"`
	Error           string         `json:"error"`
	Retriable       bool           `json:"retriable"`
	Outputs         []OutputInfo   `json:"outputs"`
	Spec            *api.AssetSpec `json:"spec"` // TODO: Update this to final schema
}

type CatalystOptions added in v0.4.17

type CatalystOptions struct {
	BaseURL    string
	Secret     string
	OwnBaseURL *url.URL
}

type HTTPStatusError

type HTTPStatusError struct {
	Status int
	Body   string
}

func (*HTTPStatusError) Error

func (e *HTTPStatusError) Error() string

type IPFS

type IPFS interface {
	PinContent(ctx context.Context, name, contentType string, data io.Reader) (cid string, metadata interface{}, err error)
	Unpin(ctx context.Context, cid string) error
	List(ctx context.Context, pageSize, pageOffset int) (*PinList, int, error)
}

func NewPinataClientAPIKey

func NewPinataClientAPIKey(apiKey, apiSecret string, filesMetadata map[string]string) IPFS

func NewPinataClientJWT

func NewPinataClientJWT(jwt string, filesMetadata map[string]string) IPFS

type OutputInfo added in v0.4.17

type OutputInfo struct {
	Type     string            `json:"type"`
	Manifest string            `json:"manifest"`
	Videos   map[string]string `json:"videos"`
}

type OutputLocation added in v0.4.17

type OutputLocation struct {
	Type            string `json:"type"`
	URL             string `json:"url"`
	PinataAccessKey string `json:"pinata_access_key"`
}

type PinInfo added in v0.4.13

type PinInfo struct {
	ID          string `json:"id"`
	IPFSPinHash string `json:"ipfs_pin_hash"`
	Size        int64  `json:"size"`
	Metadata    struct {
		Name      string            `json:"name"`
		KeyValues map[string]string `json:"keyvalues"`
	} `json:"metadata"`
}

type PinList added in v0.4.13

type PinList struct {
	Count int64     `json:"count"`
	Pins  []PinInfo `json:"rows"`
}

type Request

type Request struct {
	Method, URL string
	Body        io.Reader
	ContentType string
	Headers     map[string]string
}

type UploadVODRequest added in v0.4.17

type UploadVODRequest struct {
	Url             string           `json:"url"`
	CallbackUrl     string           `json:"callback_url"`
	Mp4Output       bool             `json:"mp4_output"`
	OutputLocations []OutputLocation `json:"output_locations,omitempty"`
}

Jump to

Keyboard shortcuts

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