endpoint

package
v5.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigFile = "config.json"

DefaultConfigFile is the default configuration file path

View Source
const DefaultHTTPSCertFile = "server.cert"

DefaultHTTPSCertFile is the default path to the SSL certificate

View Source
const DefaultHTTPSKeyFile = "server.key"

DefaultHTTPSKeyFile is the default path to the SSL key

View Source
const DefaultOutputDirectory = "./out"

DefaultOutputDirectory is the default output directory for generated content

Variables

This section is empty.

Functions

func GetTranscoderCommand

func GetTranscoderCommand(ep Endpoint) (string, []string, error)

GetTranscoderCommand produces an instruction for the transcode phase to execute

func WriteConfig

func WriteConfig(cfg Config, path string) error

WriteConfig saves a fakeOrigin config as a pretty-printed json file

Types

type Config

type Config struct {
	ServerConf ServerInfo `json:"server"`
	Endpoints  []Endpoint `json:"endpoints"`
}

Config defines the application configuration

func DefaultConfig

func DefaultConfig() Config

DefaultConfig generates a basic default configuration

func LoadAndGenerateDefaultConfig

func LoadAndGenerateDefaultConfig(path string) (Config, error)

LoadAndGenerateDefaultConfig loads the config from a given json file and puts a default value in place if you havn't stored anything

func ProcessConfig

func ProcessConfig(out Config) (Config, error)

ProcessConfig processes the config loaded from disk, or generated the first time. This must be called before the config can be used to transcode or serve.

type Endpoint

type Endpoint struct {
	ID              string              `json:"id"`
	DiskID          string              `json:"override_disk_id,omitempty"`
	Source          string              `json:"source"`
	OutputDirectory string              `json:"outputdir,omitifempty"`
	EndpointType    Type                `json:"type"`
	ManualCommand   []string            `json:"manual_command,omitempty"`
	DefaultHeaders  map[string][]string `json:"default_headers,omitempty"`
	NoCache         bool                `json:"no_cache,omitempty"`
	ABRManifests    []string            `json:"abr_manifests,omitempty"`
}

Endpoint defines all kinds of endpoints to be served

type ServerInfo

type ServerInfo struct {
	HTTPListeningPort  int    `json:"http_port"`
	HTTPSListeningPort int    `json:"https_port"`
	SSLCert            string `json:"ssl_cert"`
	SSLKey             string `json:"ssl_key"`
	BindingAddress     string `json:"binding_address"`
	CrossdomainFile    string `json:"crossdomain_xml_file"`
}

ServerInfo contains relevant info for serving content

type Type

type Type int

Type models the supported types of endpoints

const (
	InvalidType Type = iota + 1
	Vod
	Live
	Event
	Static
	Dir
)

Type models the supported types of endpoints

func (Type) MarshalJSON

func (r Type) MarshalJSON() ([]byte, error)

MarshalJSON is generated so Type satisfies json.Marshaler.

func (Type) String

func (e Type) String() string

func (*Type) UnmarshalJSON

func (r *Type) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so Type satisfies json.Unmarshaler.

Jump to

Keyboard shortcuts

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