logicclipping

package module
v0.0.0-...-6d77f2b Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 18 Imported by: 0

README

Clipping-API for Logic

Testing

Copy the .env.example to .env and fill the values

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetManifestKey

func GetManifestKey(assetName string) string

func GetPseodoRandomString

func GetPseodoRandomString() string

Types

type AwsS3ClientAPI

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

AwsS3ClientAPI describes the AwsS3ClientAPI

func NewAwsS3ClientAPI

func NewAwsS3ClientAPI(keyID, secret string) (*AwsS3ClientAPI, error)

func (*AwsS3ClientAPI) GetObject

func (api *AwsS3ClientAPI) GetObject(bucketName, key string) ([]byte, error)

func (*AwsS3ClientAPI) ListObjects

func (api *AwsS3ClientAPI) ListObjects(bucketName string) ([]*s3.Object, error)

type Clip

type Clip struct {
	s3.Object

	LocalPath string
	// contains filtered or unexported fields
}

func (*Clip) Data

func (clip *Clip) Data() ([]byte, error)

func (*Clip) Download

func (clip *Clip) Download(dir string) error

func (*Clip) DownloadAs

func (clip *Clip) DownloadAs(dir, format string) error

func (*Clip) FileName

func (clip *Clip) FileName() string

func (*Clip) Transcode

func (clip *Clip) Transcode(format string) error

type ClipRequest

type ClipRequest struct {
	// StartTime in UTC
	StartTime time.Time `json:"startTime"`

	// EndTime in UTC
	EndTime          time.Time `json:"endTime"`
	ID               string    `json:"id"`
	BucketName       string    `json:"bucketName"`
	ManifestKey      string    `json:"manifestKey"`
	RoleArn          string    `json:"roleArn"`
	OriginEndpointID string    `json:"originEndpointId"`
}

type CreateClipResponse

type CreateClipResponse struct {
	Result struct {
		Harvestjob
	} `json:"result"`
}

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

type GetJobRequest

type GetJobRequest struct {
	ChannelID string `json:"id"`
}

type GetJobResponse

type GetJobResponse struct {
	Result struct {
		Harvestjobs []*Harvestjob `json:"HarvestJobs"`
		Nexttoken   string        `json:"NextToken"`
	} `json:"result"`
}

type Harvestjob

type Harvestjob struct {
	Arn              string        `json:"Arn"`
	Channelid        string        `json:"ChannelId"`
	Createdat        time.Time     `json:"CreatedAt"`
	Endtime          time.Time     `json:"EndTime"`
	ID               string        `json:"Id"`
	Originendpointid string        `json:"OriginEndpointId"`
	S3Destination    S3Destination `json:"S3Destination"`
	Starttime        time.Time     `json:"StartTime"`
	Status           string        `json:"Status"`
}

type LogicConnection

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

func NewLogicConnection

func NewLogicConnection(apiKey, apiEndpoint, bucketInputName, bucketOutputName, roleArn string) (*LogicConnection, error)

func (*LogicConnection) CreateClip

func (lc *LogicConnection) CreateClip(clipRequest ClipRequest) (*CreateClipResponse, error)

func (*LogicConnection) CreateMultiClip

func (lc *LogicConnection) CreateMultiClip(multiClipRequest *MultiClipRequest) ([]*CreateClipResponse, error)

func (*LogicConnection) CreateMultiClipDelayedUntilEndTime

func (lc *LogicConnection) CreateMultiClipDelayedUntilEndTime(multiClipRequest *MultiClipRequest) ([]*CreateClipResponse, error)

func (*LogicConnection) Do

func (lc *LogicConnection) Do(req *http.Request) (*http.Response, error)

func (*LogicConnection) GetChannelIDs

func (lc *LogicConnection) GetChannelIDs() []string

func (*LogicConnection) GetClipByAssetName

func (lc *LogicConnection) GetClipByAssetName(assetName string) (*Clip, error)

func (*LogicConnection) GetClips

func (lc *LogicConnection) GetClips() ([]*Clip, error)

func (*LogicConnection) GetJobs

func (lc *LogicConnection) GetJobs(channelIDs []string) ([]*Harvestjob, error)

func (*LogicConnection) GetJobsForChannel

func (lc *LogicConnection) GetJobsForChannel(channelID string) ([]*Harvestjob, error)

func (*LogicConnection) GetOriginEndpointIDs

func (lc *LogicConnection) GetOriginEndpointIDs() []string

func (*LogicConnection) Post

func (lc *LogicConnection) Post(url string, body io.Reader) (resp *http.Response, err error)

func (*LogicConnection) SetChannelIDs

func (lc *LogicConnection) SetChannelIDs(ids []string)

func (*LogicConnection) SetOriginEndpointIDs

func (lc *LogicConnection) SetOriginEndpointIDs(ids []string)

type MultiClipRequest

type MultiClipRequest struct {
	AssetName string
	// StartTime in UTC
	StartTime time.Time `json:"startTime"`

	// EndTime in UTC
	EndTime           time.Time `json:"endTime"`
	BucketName        string    `json:"bucketName"`
	RoleArn           string    `json:"roleArn"`
	OriginEndpointIDs []string  `json:"originEndpointIds"`
}

func (*MultiClipRequest) ToClipRequests

func (mcr *MultiClipRequest) ToClipRequests() []ClipRequest

type S3Destination

type S3Destination struct {
	Bucketname  string `json:"BucketName"`
	Manifestkey string `json:"ManifestKey"`
	Rolearn     string `json:"RoleArn"`
}

Jump to

Keyboard shortcuts

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