Documentation ¶
Index ¶
- Constants
- func BytesVal(bytes int64) (int64, string)
- func CheckPid(pidFile string) (int, error)
- func ChunkAndHash(url string, size int64) string
- func CleanCtype(ctype string) string
- func ConvertArrayInterfaceToString(list []interface{}) (values []string)
- func ConvertFromUUIDFormat(uuid string) string
- func ConvertToUUIDFormat(uuid string) string
- func CopyDir(srcDir string, dstDir string) (err error)
- func CopyFile(src string, dst string) (err error)
- func CtypeToExt(ctype string) string
- func DownloadChunk(url string, size int64) (body []byte, err error)
- func DurFromLabel(label string) time.Duration
- func DurVal(dur time.Duration) (int, string)
- func EmptyJson(val json.RawMessage) bool
- func ExtToCtype(ext string) string
- func FindString(list []string, find string) int
- func GenerateMD5(file io.Reader, fileSize, maxSize int64) (hash string, hashSize int64)
- func GetAwsSignature(message, secret string) string
- func GetDB(def_url ...string) string
- func GetDir(u string) string
- func GetExtByType(assetType string) string
- func GetFileExtension(ctype string) string
- func GetMetadataStringVal(metadata json.RawMessage, field string) string
- func GetMultipartSignature(headers, awsSecret string) []byte
- func GetOsEnv(env string, mandatory bool, defaultValue ...string) (value string)
- func GetTypeByExt(ext string) string
- func IsColor(str string) bool
- func IsNumber(str string) bool
- func IsSSL(r *http.Request) bool
- func Label(dur time.Duration) string
- func LoadFromCache(name string, c Cacheable, obj interface{}) bool
- func NewError(msg string, args ...interface{}) error
- func ParseBool(key string, urlMap url.Values, defaultValue ...bool) bool
- func ParseColor(key string, urlMap url.Values, defaultValue ...string) string
- func ParseDatabaseUrl(dbUrl string) string
- func ParseInt(key string, urlMap url.Values, defaultValue ...int) int
- func ParseString(key string, urlMap url.Values, defaultValue ...string) string
- func ParseType(type_ string) string
- func PurgeFromCache(name string, c Cacheable) bool
- func SaveToCache(name string, c Cacheable, obj interface{}) bool
- func Timestamp(t time.Time) string
- func UpdateHerokuVar(authKey, appName string, config interface{}) error
- func ValidUUID(uuid string) bool
- func ValidV2Token(token string) bool
- type Browser
- type CDNEvent
- type Cacheable
- type Cli
- func (c *Cli) DefaultSetup(msg, def string)
- func (c *Cli) GetBool(name string) bool
- func (c Cli) GetCacheAge() time.Duration
- func (c Cli) GetCacheFile(name string) string
- func (c *Cli) GetFilter(fta ...string) (filter string, filterType string)
- func (c *Cli) GetInt(name string) int
- func (c *Cli) GetSeconds(name string) time.Duration
- func (c *Cli) GetSleep() time.Duration
- func (c *Cli) GetString(name string) string
- func (c *Cli) GetTime(name string, dur time.Duration) time.Duration
- func (c *Cli) Int(name string, def int, desc string)
- func (c *Cli) Parse(args ...[]string)
- func (c Cli) Printf(msg string, args ...interface{})
- func (c Cli) Println(msg string)
- func (c *Cli) String(name, def, desc string)
- type Email
- type EmailRequest
- type EmailResponse
- type ExecObj
- type GeoInfo
- type GeoLocation
- type HerokuResponse
- type KeenClient
- func (c *KeenClient) AddEvent(event KeenEvent) ([]byte, error)
- func (c *KeenClient) AddEvents(events map[string][]KeenEvent) ([]byte, error)
- func (c *KeenClient) Request(method, path string, payload interface{}) (*http.Response, error)
- func (c *KeenClient) Response(resp *http.Response) ([]byte, error)
- type KeenEvent
- type KeenProperties
- type Ret
- func (r *Ret) Add(type_ string)
- func (r *Ret) AddBytes(bytes int64)
- func (r *Ret) AddBytesFor(key string, bytes int64)
- func (r *Ret) AddDurFor(key string, dur time.Duration)
- func (r *Ret) AddError(err error) bool
- func (r *Ret) AddFor(type_ string, ct int)
- func (r *Ret) AddForSave(key string, id string)
- func (r *Ret) Bytes(type_ string) int64
- func (r *Ret) Duration(type_ string) time.Duration
- func (r *Ret) Eq(type_ string, ct int) bool
- func (r *Ret) GetErrorString() string
- func (r *Ret) Gt(type_ string, ct int) bool
- func (r *Ret) Gte(type_ string, ct int) bool
- func (r *Ret) IsErrored() bool
- func (r *Ret) LimitReached(limit int) bool
- func (r *Ret) Lt(type_ string, ct int) bool
- func (r *Ret) Lte(type_ string, ct int) bool
- func (r *Ret) Print()
- func (r *Ret) Save(dir string) error
- func (r *Ret) Speed() string
- func (r *Ret) String() string
- func (r *Ret) Taken(tDur ...time.Duration) (int, string)
- func (r *Ret) Value(type_ string) int
- type SynqError
Constants ¶
View Source
const ( UPLOADED_STATE = `video.state == "uploaded" && video.userdata.hydra && video.userdata.hydra.job_state == "completed"` HAS_DASH = `video.userdata.hydra.outputs.dash && video.userdata.hydra.outputs.dash.metadata` HAS_HLS = `video.userdata.hydra.outputs.hls` )
View Source
const (
DEFAULT_DB_URL = "postgres://circleci:circleci@localhost:5432/db_test?sslmode=disable"
)
View Source
const ERIS_STAGING_URL = "https://4oiv2vbc7l.execute-api.eu-central-1.amazonaws.com/stage/eris"
View Source
const HEROKU_BASE_URL = "https://api.heroku.com/"
Variables ¶
This section is empty.
Functions ¶
func ChunkAndHash ¶
func CleanCtype ¶
func ConvertArrayInterfaceToString ¶
func ConvertArrayInterfaceToString(list []interface{}) (values []string)
func ConvertFromUUIDFormat ¶
func ConvertToUUIDFormat ¶
return 32 bytes into 36 bytes xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
func CopyDir ¶
CopyDir will walk through each file in srcDir, and call CopyFile on that file into dstDir.
func CopyFile ¶
Copied and modified from https://stackoverflow.com/questions/21060945/simple-way-to-copy-a-file-in-golang CopyFile copies a file from src to dst. If src and dst files exist, and are the same, then return success. Copy the file contents from src to dst.
func CtypeToExt ¶
func DurFromLabel ¶
func EmptyJson ¶
func EmptyJson(val json.RawMessage) bool
func ExtToCtype ¶
func FindString ¶
func GenerateMD5 ¶
func GetAwsSignature ¶
func GetExtByType ¶
func GetFileExtension ¶
func GetMetadataStringVal ¶
func GetMetadataStringVal(metadata json.RawMessage, field string) string
Parses the metadata and returns the value of the specified field
func GetMultipartSignature ¶
Multipart Upload
func GetTypeByExt ¶
func LoadFromCache ¶
func ParseDatabaseUrl ¶
this parses the database url and returns it in the format sqlx.DB expects
func PurgeFromCache ¶
func SaveToCache ¶
func UpdateHerokuVar ¶
Types ¶
type CDNEvent ¶
type CDNEvent struct { CdnName string `json:"cdn"` CreatedAt string `json:"created_at"` HTTPMethod string `json:"method"` ServerIP string `json:"server_ip"` Protocol string `json:"protocol"` Referrer string `json:"referrer"` Filesize int64 `json:"filesize"` BytesRequest int64 `json:"bytes_request"` BytesResponse int64 `json:"bytes_response"` Duration string `json:"duration"` StatusCode string `json:"status"` URI string `json:"url"` ProjectId string `json:"project_uuid"` VideoId string `json:"video_uuid"` }
type Cli ¶
type Cli struct { Command string Timeout time.Duration Sleep time.Duration Simulate bool Limit int CacheDir string CacheAge time.Duration Flag *flag.FlagSet Args map[string]interface{} }
func (*Cli) DefaultSetup ¶
func (Cli) GetCacheAge ¶
func (Cli) GetCacheFile ¶
type Email ¶
type Email struct { EmailUrl string Request EmailRequest Response EmailResponse }
func (*Email) SetMsgAndSend ¶
type EmailRequest ¶
type EmailResponse ¶
type ExecObj ¶
type ExecObj struct { Cmd *exec.Cmd ReadOut []byte ReadErr []byte RunErr error Err SynqError // contains filtered or unexported fields }
func (*ExecObj) Exec ¶
func (e *ExecObj) Exec(fn func(io.WriteCloser))
func (*ExecObj) MarshalError ¶
func (*ExecObj) StatusBody ¶
func (*ExecObj) StatusCode ¶
type GeoLocation ¶
type HerokuResponse ¶
type KeenClient ¶
type KeenClient struct { WriteKey string ReadKey string ProjectId string Collection string Url string HttpClient http.Client Events map[string][]KeenEvent }
func (*KeenClient) AddEvents ¶
func (c *KeenClient) AddEvents(events map[string][]KeenEvent) ([]byte, error)
type KeenEvent ¶
type KeenEvent struct { Keen KeenProperties `json:"keen"` CDNEvent CDNEvent `json:"cdn_event"` GeoLocation GeoLocation `json:"geo"` Browser Browser `json:"browser"` }
type KeenProperties ¶
type KeenProperties struct {
Timestamp string `json:"timestamp"`
}
type Ret ¶
type Ret struct { Label string CountMap map[string]int Error error Start time.Time DurMap map[string]time.Duration BytesMap map[string]int64 IdMap map[string][]string }
func (*Ret) AddBytesFor ¶
func (*Ret) AddForSave ¶
func (*Ret) GetErrorString ¶
func (*Ret) LimitReached ¶
Click to show internal directories.
Click to hide internal directories.