backend

package
v0.9.12 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DatastoreProductions collection PRODUCTION
	DatastoreProductions = "PRODUCTIONS"
)
View Source
const (
	// DatastoreResources collection RESOURCE
	DatastoreResources = "RESOURCES"
)
View Source
const (
	// full canonical route
	ImportTaskWithPrefix = "/_t/import"
)

Variables

This section is empty.

Functions

func CreateProduction

func CreateProduction(ctx context.Context, name, title, summary, clientID string) (*podops.Production, error)

CreateProduction initializes a new show and all its metadata

func DeleteResource

func DeleteResource(ctx context.Context, guid string) error

DeleteResource deletes a resource and it's backing .yaml file

func EnsureAsset

func EnsureAsset(ctx context.Context, production string, rsrc *podops.Asset) error

EnsureAsset validates the existence of the asset and imports it if necessary

func FindProductionByName

func FindProductionByName(ctx context.Context, name string) (*podops.Production, error)

FindProductionByName does a lookup using the productions name instead of its key

func FindProductionsByOwner

func FindProductionsByOwner(ctx context.Context, owner string) ([]*podops.Production, error)

FindProductionsByOwner returns all productions belonging to the same owner

func FindResource

func FindResource(ctx context.Context, production, name string) (*podops.Resource, error)

FindResource looks for a resource 'name' in the context of production 'production'

func GetProduction

func GetProduction(ctx context.Context, production string) (*podops.Production, error)

GetProduction returns a production based on the GUID

func GetResource

func GetResource(ctx context.Context, guid string) (*podops.Resource, error)

GetResource retrieves a resource

func GetResourceContent

func GetResourceContent(ctx context.Context, guid string) (interface{}, error)

GetResourceContent retrieves a resource file

func ImportResource

func ImportResource(ctx context.Context, src, dest, original string) int

ImportResource import a resource from a src and place it into the CDN

func ListResources

func ListResources(ctx context.Context, production, kind string) ([]*podops.Resource, error)

ListResources returns all resources of type kind belonging to parentID

func LoadResource

func LoadResource(data []byte) (interface{}, string, string, error)

LoadResource takes a byte array and determines its kind before unmarshalling it into its struct form

func LoadResourceMetadata

func LoadResourceMetadata(data []byte) (*podops.ResourceMetadata, error)

LoadResourceMetadata reads only the metadata of a resource

func NormalizeKind

func NormalizeKind(kind string) (string, error)

func ReadResource

func ReadResource(ctx context.Context, path string) (interface{}, string, string, error)

ReadResource reads a resource from Cloud Storage

func RemoveAsset

func RemoveAsset(ctx context.Context, path string) error

RemoveAsset removes a asset from Cloud Storage

func RemoveResource

func RemoveResource(ctx context.Context, path string) error

RemoveResource removes a resource from Cloud Storage

func UpdateAsset

func UpdateAsset(ctx context.Context, name, guid, kind, production, location, contentType, original, etag string, size, duration int64) error

UpdateAsset updates the resource inventory

func UpdateEpisode

func UpdateEpisode(ctx context.Context, location string, episode *podops.Episode) error

UpdateEpisode is a helper function to update a episode resource

func UpdateProduction

func UpdateProduction(ctx context.Context, p *podops.Production) error

UpdateProduction does what the name suggests

func UpdateResource

func UpdateResource(ctx context.Context, name, guid, kind, production, location string) error

UpdateResource updates the resource inventory

func UpdateShow

func UpdateShow(ctx context.Context, location string, show *podops.Show) error

UpdateShow is a helper function to update a show resource

func ValidateProduction

func ValidateProduction(ctx context.Context, production string) error

ValidateProduction checks the integrity of a production and fixes issues if possible

func WriteResourceContent

func WriteResourceContent(ctx context.Context, path string, create, force bool, rsrc interface{}) error

WriteResourceContent creates a resource .yaml file. An existing resource will be overwritten if force==true

Types

type ContentMetadata

type ContentMetadata struct {
	Size        int64
	Duration    int64
	ContentType string
	Etag        string
	Timestamp   int64
}

ContentMetadata keeps basic data on resource

type ResourceLoaderFunc

type ResourceLoaderFunc func(data []byte) (interface{}, string, error)

ResourceLoaderFunc implements loading of resources

Jump to

Keyboard shortcuts

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