clients

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrYieldExecution     = errors.New("yield execution")
	CatalystStatusSuccess = clients.TranscodeStatusCompleted.String()
	CatalystStatusError   = clients.TranscodeStatusError.String()
)
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, attemptID string) string
}

func NewCatalyst added in v0.4.17

func NewCatalyst(opts CatalystOptions) Catalyst

type CatalystCallback added in v0.4.17

type CatalystCallback = clients.TranscodeStatusCompletedMessage

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 OutputLocation added in v0.4.17

type OutputLocation struct {
	Type            string          `json:"type"`
	URL             string          `json:"url,omitempty"`
	PinataAccessKey string          `json:"pinata_access_key,omitempty"`
	Outputs         *OutputsRequest `json:"outputs,omitempty"`
}

type OutputsRequest added in v0.5.0

type OutputsRequest struct {
	SourceMp4          bool `json:"source_mp4"`
	SourceSegments     bool `json:"source_segments"`
	TranscodedSegments bool `json:"transcoded_segments"`
}

type PinInfo added in v0.4.13

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

type PinList added in v0.4.13

type PinList struct {
	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"`
	OutputLocations []OutputLocation `json:"output_locations,omitempty"`
}

Jump to

Keyboard shortcuts

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