resources

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DatastoreProductions collection PRODUCTION
	DatastoreProductions = "PRODUCTIONS"
)

Variables

This section is empty.

Functions

func Build

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

Build gathers all resources and builds the feed

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) (*metadata.ResourceMetadata, error)

LoadResourceMetadata reads only the metadata of a resource

func ReadResource

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

ReadResource reads a resource from Cloud Storage

func WriteResource

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

WriteResource creates a resource. An existing resource will be overwritten if force==true

Types

type EpisodeList

type EpisodeList []*metadata.Episode

func (EpisodeList) Len

func (e EpisodeList) Len() int

func (EpisodeList) Less

func (e EpisodeList) Less(i, j int) bool

func (EpisodeList) Swap

func (e EpisodeList) Swap(i, j int)

type Production

type Production struct {
	GUID      string `json:"guid"`
	Owner     string `json:"owner"`
	Name      string `json:"name"`
	Title     string `json:"title"`
	Summary   string `json:"summary"`
	Feed      string `json:"feed"`
	NewFeed   string `json:"newFeed"`
	PubDate   int64  `json:"pub_date"`
	BuildDate int64  `json:"build_date"`
	// internal
	Created int64 `json:"-"`
	Updated int64 `json:"-"`
}

Production holds the shows main data

func CreateProduction

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

CreateProduction initializes a new show and all its metadata

func FindProductionByName

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

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

func FindProductionsByOwner

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

FindProductionsByOwner returns all productions belonging to the same owner

func GetProduction

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

GetProduction returns a production based on the GUID

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