models

package
v0.0.0-...-6f193cf Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDB

func InitDB()

InitDB return instance redis client

Types

type Device

type Device struct {
	UUID       string `json:"uuid"`
	Token      string `json:"token"`
	SecretHash string `json:"secretHash"`
}

Device struct used to store informations during the use of voodfycli

func GetBySecretHash

func GetBySecretHash(secret string) (device Device, ok bool)

GetBySecretHash return a device save on redis

func (*Device) Get

func (d *Device) Get()

Get return a device save on redis

func (*Device) MarshalBinary

func (d *Device) MarshalBinary() ([]byte, error)

MarshalBinary retrieve resource from binary

func (*Device) Save

func (d *Device) Save() bool

Save add device to redis

func (*Device) ToSignup

func (d *Device) ToSignup() map[string]interface{}

ToSignup return map to used on signup

func (*Device) UnmarshalBinary

func (d *Device) UnmarshalBinary(data []byte) error

UnmarshalBinary bind device save on redis

func (*Device) Update

func (d *Device) Update()

Update update device to redis

type Directory

type Directory struct {
	ID        string    `json:"id"`
	CID       string    `json:"cid"`
	Resources Resources `json:"resources"`
}

Directory struct used to bind a directory

func (*Directory) Get

func (d *Directory) Get()

Get return a directory save on redis

func (*Directory) MarshalBinary

func (d *Directory) MarshalBinary() ([]byte, error)

MarshalBinary retrieve resource from binary

func (*Directory) Save

func (d *Directory) Save()

Save add directory to redis

func (*Directory) UnmarshalBinary

func (d *Directory) UnmarshalBinary(data []byte) error

UnmarshalBinary bind directory save on redis

type Models

type Models struct {
	Redis *redis.Client
}

Models struct ...

type Resource

type Resource struct {
	ID   string `json:"id"`
	Jid  string `json:"jid"`
	Name string `json:"name"`
	CID  string `json:"cid"`
}

Resource struct used to bind a resource

type Resources

type Resources []Resource

Resources array of resource

type Specification

type Specification struct {
	ID     string `json:"id"`
	Format struct {
		BitRate        string `json:"bit_rate"`
		Duration       string `json:"duration"`
		Filename       string `json:"filename"`
		FormatLongName string `json:"format_long_name"`
		FormatName     string `json:"format_name"`
		NbPrograms     int    `json:"nb_programs"`
		NbStreams      int    `json:"nb_streams"`
		ProbeScore     int    `json:"probe_score"`
		Size           string `json:"size"`
		StartTime      string `json:"start_time"`
		Tags           struct {
			CompatibleBrands string `json:"compatible_brands"`
			Encoder          string `json:"encoder"`
			MajorBrand       string `json:"major_brand"`
			MinorVersion     string `json:"minor_version"`
		} `json:"tags"`
	} `json:"format"`
	Streams []struct {
		AvgFrameRate       string `json:"avg_frame_rate"`
		BitRate            string `json:"bit_rate"`
		BitsPerRawSample   string `json:"bits_per_raw_sample,omitempty"`
		ChromaLocation     string `json:"chroma_location,omitempty"`
		CodecLongName      string `json:"codec_long_name"`
		CodecName          string `json:"codec_name"`
		CodecTag           string `json:"codec_tag"`
		CodecTagString     string `json:"codec_tag_string"`
		CodecTimeBase      string `json:"codec_time_base"`
		CodecType          string `json:"codec_type"`
		CodedHeight        int    `json:"coded_height,omitempty"`
		CodedWidth         int    `json:"coded_width,omitempty"`
		DisplayAspectRatio string `json:"display_aspect_ratio,omitempty"`
		Disposition        struct {
			AttachedPic     int `json:"attached_pic"`
			CleanEffects    int `json:"clean_effects"`
			Comment         int `json:"comment"`
			Default         int `json:"default"`
			Dub             int `json:"dub"`
			Forced          int `json:"forced"`
			HearingImpaired int `json:"hearing_impaired"`
			Karaoke         int `json:"karaoke"`
			Lyrics          int `json:"lyrics"`
			Original        int `json:"original"`
			TimedThumbnails int `json:"timed_thumbnails"`
			VisualImpaired  int `json:"visual_impaired"`
		} `json:"disposition"`
		Duration          string `json:"duration"`
		DurationTs        int    `json:"duration_ts"`
		HasBFrames        int    `json:"has_b_frames,omitempty"`
		Height            int    `json:"height,omitempty"`
		Index             int    `json:"index"`
		IsAvc             string `json:"is_avc,omitempty"`
		Level             int    `json:"level,omitempty"`
		NalLengthSize     string `json:"nal_length_size,omitempty"`
		NbFrames          string `json:"nb_frames"`
		PixFmt            string `json:"pix_fmt,omitempty"`
		Profile           string `json:"profile"`
		RFrameRate        string `json:"r_frame_rate"`
		Refs              int    `json:"refs,omitempty"`
		SampleAspectRatio string `json:"sample_aspect_ratio,omitempty"`
		StartPts          int    `json:"start_pts"`
		StartTime         string `json:"start_time"`
		Tags              struct {
			HandlerName string `json:"handler_name"`
			Language    string `json:"language"`
		} `json:"tags"`
		TimeBase      string `json:"time_base"`
		Width         int    `json:"width,omitempty"`
		BitsPerSample int    `json:"bits_per_sample,omitempty"`
		ChannelLayout string `json:"channel_layout,omitempty"`
		Channels      int    `json:"channels,omitempty"`
		MaxBitRate    string `json:"max_bit_rate,omitempty"`
		SampleFmt     string `json:"sample_fmt,omitempty"`
		SampleRate    string `json:"sample_rate,omitempty"`
	} `json:"streams"`
}

Specification struct to save info provided by ffprobe

func (*Specification) Get

func (s *Specification) Get()

Get return a specification save on redis

func (*Specification) MarshalBinary

func (s *Specification) MarshalBinary() ([]byte, error)

MarshalBinary retrieve resource from binary

func (*Specification) Save

func (s *Specification) Save() bool

Save add specification to redis

func (*Specification) UnmarshalBinary

func (s *Specification) UnmarshalBinary(data []byte) error

UnmarshalBinary bind specification save on redis

func (*Specification) Update

func (s *Specification) Update()

Update update specification to redis

Jump to

Keyboard shortcuts

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