mirakurun: ykzts.com/x/mirakurun Index | Examples | Files

package mirakurun

import "ykzts.com/x/mirakurun"

Package mirakurun provides Mirakurun API client.

The Mirakurun API specification is at https://github.com/Chinachu/Mirakurun/blob/master/api.yml.

Index

Examples

Package Files

channels.go doc.go events.go mirakurun.go programs.go server.go services.go timestamp.go tuners.go

type Channel Uses

type Channel struct {
    Type     string    `json:"type"`
    Channel  string    `json:"channel"`
    Name     string    `json:"name,omitempty"`
    Satelite string    `json:"satelite,omitempty"`
    Space    int64     `json:"space,omitempty"`
    Services []Service `json:"services,omitempty"`
}

Channel represents a Mirakurun channel.

type ChannelConfig Uses

type ChannelConfig struct {
    Name       string `json:"name"`
    Type       string `json:"type"`
    Channel    string `json:"channel"`
    Satelite   string `json:"satelite,omitempty"`
    ServiceID  int    `json:"serviceId,omitempty"`
    Space      int    `json:"space,omitempty"`
    IsDisabled bool   `json:"isDisabled,omitempty"`
}

ChannelConfig represents a Mirakurun channel config

type ChannelScanOptions Uses

type ChannelScanOptions struct {
    Type string `url:"type,omitempty"`
    Min  int    `url:"min,omitempty"`
    Max  int    `url:"max,omitempty"`
}

ChannelScanOptions specifies the optional parameters to the Client.ChannelScan method.

type ChannelsConfig Uses

type ChannelsConfig []*ChannelConfig

ChannelsConfig represents a Mirakurun channels config.

type ChannelsListOptions Uses

type ChannelsListOptions struct {
    Type    string `url:"type,omitempty"`
    Channel string `url:"channel,omitempty"`
    Name    string `url:"name,omitempty"`
}

ChannelsListOptions specifies the optional parameters to the Client.GetChannels method and Client.GetChannelsByType method.

type Client Uses

type Client struct {
    BaseURL   *url.URL
    Priority  int
    UserAgent string
    // contains filtered or unexported fields
}

A Client manages communication with the Mirakurun API.

func NewClient Uses

func NewClient() *Client

NewClient returns a new Mirakurun API client.

Code:

c := mirakurun.NewClient()
c.BaseURL, _ = url.Parse("http://192.168.0.5:40772/api/")

programs, _, err := c.GetPrograms(context.Background(), nil)
if err != nil {
    log.Fatal(err)
}

fmt.Println("Program count: ", len(programs))

func (*Client) ChannelScan Uses

func (c *Client) ChannelScan(ctx context.Context, opt *ChannelScanOptions) (io.ReadCloser, *http.Response, error)

ChannelScan scans a channels.

Code:

c := mirakurun.NewClient()

stream, _, err := c.ChannelScan(context.Background(), nil)
if err != nil {
    log.Fatal(err)
}
defer stream.Close()

io.Copy(os.Stdout, stream)

func (*Client) CheckVersion Uses

func (c *Client) CheckVersion(ctx context.Context) (*Version, *http.Response, error)

CheckVersion fetches a Mirakurun version.

Code:

c := mirakurun.NewClient()

version, _, err := c.CheckVersion(context.Background())
if err != nil {
    log.Fatal(err)
}

fmt.Println("Current: " + version.Current)
fmt.Println("Latest: " + version.Latest)

func (*Client) Do Uses

func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*http.Response, error)

Do sends an API requests and returns the API response.

func (*Client) GetChannel Uses

func (c *Client) GetChannel(ctx context.Context, typ string, channelID string) (*Channel, *http.Response, error)

GetChannel fetches a channel.

Code:

c := mirakurun.NewClient()

channel, _, err := c.GetChannel(context.Background(), "GR", "16")
if err != nil {
    log.Fatal(err)
}

fmt.Printf("%s (%s): %s\n", channel.Channel, channel.Type, channel.Name)

func (*Client) GetChannels Uses

func (c *Client) GetChannels(ctx context.Context, opt *ChannelsListOptions) ([]*Channel, *http.Response, error)

GetChannels lists the channels.

Code:

c := mirakurun.NewClient()

channels, _, err := c.GetChannels(context.Background(), nil)
if err != nil {
    log.Fatal(err)
}

for _, channel := range channels {
    fmt.Printf("%s (%s): %s\n", channel.Channel, channel.Type, channel.Name)
}

func (*Client) GetChannelsByType Uses

func (c *Client) GetChannelsByType(ctx context.Context, typ string, opt *ChannelsListOptions) ([]*Channel, *http.Response, error)

GetChannelsByType lists the channels for the specified type.

Code:

c := mirakurun.NewClient()

channels, _, err := c.GetChannelsByType(context.Background(), "GR", nil)
if err != nil {
    log.Fatal(err)
}

for _, channel := range channels {
    fmt.Printf("%s (%s): %s\n", channel.Channel, channel.Type, channel.Name)
}

func (*Client) GetChannelsConfig Uses

func (c *Client) GetChannelsConfig(ctx context.Context) (ChannelsConfig, *http.Response, error)

GetChannelsConfig fetches a channels config.

Code:

c := mirakurun.NewClient()

config, _, err := c.GetChannelsConfig(context.Background())
if err != nil {
    log.Fatal(err)
}

for _, cItem := range config {
    fmt.Printf("%s: %v\n", cItem.Name, cItem.IsDisabled)
}

func (*Client) GetEvents Uses

func (c *Client) GetEvents(ctx context.Context) ([]*Event, *http.Response, error)

GetEvents lists the events.

Code:

c := mirakurun.NewClient()

events, _, err := c.GetEvents(context.Background())
if err != nil {
    log.Fatal(err)
}

for _, event := range events {
    fmt.Printf("%s: %s\n", event.Resource, event.Type)
}

func (*Client) GetEventsStream Uses

func (c *Client) GetEventsStream(ctx context.Context, opt *EventsListOptions) (io.ReadCloser, *http.Response, error)

GetEventsStream fetches a events stream.

Code:

c := mirakurun.NewClient()

stream, _, err := c.GetEventsStream(context.Background(), nil)
if err != nil {
    log.Fatal(err)
}
defer stream.Close()

io.Copy(os.Stdout, stream)

func (*Client) GetLog Uses

func (c *Client) GetLog(ctx context.Context) (*bytes.Buffer, *http.Response, error)

GetLog fetches a log.

Code:

c := mirakurun.NewClient()

buf, _, err := c.GetLog(context.Background())
if err != nil {
    log.Fatal(err)
}

fmt.Println(buf)

func (*Client) GetLogStream Uses

func (c *Client) GetLogStream(ctx context.Context) (io.ReadCloser, *http.Response, error)

GetLogStream fetches a log stream.

Code:

c := mirakurun.NewClient()

stream, _, err := c.GetLogStream(context.Background())
if err != nil {
    log.Fatal(err)
}
defer stream.Close()

io.Copy(os.Stdout, stream)

func (*Client) GetLogoImage Uses

func (c *Client) GetLogoImage(ctx context.Context, id int) (io.ReadCloser, *http.Response, error)

GetLogoImage fetches a service logo stream.

Code:

filename := fmt.Sprintf("/tmp/logo-%d.png", time.Now().Unix())

file, err := os.Create(filename)
if err != nil {
    log.Fatal(err)
}

c := mirakurun.NewClient()

stream, _, err := c.GetLogoImage(context.Background(), 3239123608)
if err != nil {
    log.Fatal(err)
}
defer stream.Close()

fmt.Println("output: ", filename)
io.Copy(file, stream)

func (*Client) GetProgram Uses

func (c *Client) GetProgram(ctx context.Context, id int) (*Program, *http.Response, error)

GetProgram fetches a program.

Code:

c := mirakurun.NewClient()

program, _, err := c.GetProgram(context.Background(), 323912360802956)
if err != nil {
    log.Fatal(err)
}

fmt.Printf("%d: %s (%v)\n", program.ID, program.Name, program.StartAt)
fmt.Println(program.Description)

if program.Extended != nil {
    fmt.Println("")
    for key, value := range program.Extended {
        fmt.Printf("%s: %s\n", key, value)
    }
}

func (*Client) GetProgramStream Uses

func (c *Client) GetProgramStream(ctx context.Context, id int, decode bool) (io.ReadCloser, *http.Response, error)

GetProgramStream fetches a program stream.

Code:

filename := fmt.Sprintf("/tmp/stream-%d.ts", time.Now().Unix())

file, err := os.Create(filename)
if err != nil {
    log.Fatal(err)
}

c := mirakurun.NewClient()

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

stream, _, err := c.GetProgramStream(ctx, 323912360802956, true)
if err != nil {
    log.Fatal(err)
}
defer stream.Close()

fmt.Println("output: ", filename)
io.Copy(file, stream)

func (*Client) GetPrograms Uses

func (c *Client) GetPrograms(ctx context.Context, opt *ProgramsListOptions) ([]*Program, *http.Response, error)

GetPrograms lists the programs.

Code:

c := mirakurun.NewClient()

opt := &mirakurun.ProgramsListOptions{ServiceID: 23608}
programs, _, err := c.GetPrograms(context.Background(), opt)
if err != nil {
    log.Fatal(err)
}

for _, program := range programs {
    fmt.Printf("%d: %s (%v)\n", program.ID, program.Name, program.StartAt)
}

func (*Client) GetServerConfig Uses

func (c *Client) GetServerConfig(ctx context.Context) (*ServerConfig, *http.Response, error)

GetServerConfig fetches a server config.

Code:

c := mirakurun.NewClient()

config, _, err := c.GetServerConfig(context.Background())
if err != nil {
    log.Fatal(err)
}

fmt.Printf(":%d%s\n", config.Port, config.Path)

func (*Client) GetService Uses

func (c *Client) GetService(ctx context.Context, id int) (*Service, *http.Response, error)

GetService fetches a service.

Code:

c := mirakurun.NewClient()

service, _, err := c.GetService(context.Background(), 3239123608)
if err != nil {
    log.Fatal(err)
}

fmt.Printf("%d: %s\n", service.ID, service.Name)

func (*Client) GetServiceByChannel Uses

func (c *Client) GetServiceByChannel(ctx context.Context, typ string, channel string, sid int) (*Service, *http.Response, error)

GetServiceByChannel fetches a service for the specified channel.

Code:

c := mirakurun.NewClient()

service, _, err := c.GetServiceByChannel(context.Background(), "GR", "16", 3239123608)
if err != nil {
    log.Fatal(err)
}

fmt.Printf("%d: %s\n", service.ID, service.Name)

func (*Client) GetServiceStream Uses

func (c *Client) GetServiceStream(ctx context.Context, id int, decode bool) (io.ReadCloser, *http.Response, error)

GetServiceStream fetches a service stream.

Code:

filename := fmt.Sprintf("/tmp/stream-%d.ts", time.Now().Unix())

file, err := os.Create(filename)
if err != nil {
    log.Fatal(err)
}

c := mirakurun.NewClient()

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

stream, _, err := c.GetServiceStream(ctx, 3239123608, true)
if err != nil {
    log.Fatal(err)
}
defer stream.Close()

fmt.Println("output: ", filename)
io.Copy(file, stream)

func (*Client) GetServiceStreamByChannel Uses

func (c *Client) GetServiceStreamByChannel(ctx context.Context, typ string, channel string, sid int, decode bool) (io.ReadCloser, *http.Response, error)

GetServiceStreamByChannel fetches a service stream for the specified channel.

Code:

filename := fmt.Sprintf("/tmp/stream-%d.ts", time.Now().Unix())

file, err := os.Create(filename)
if err != nil {
    log.Fatal(err)
}

c := mirakurun.NewClient()

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

stream, _, err := c.GetServiceStreamByChannel(ctx, "GR", "16", 3239123608, true)
if err != nil {
    log.Fatal(err)
}
defer stream.Close()

fmt.Println("output: ", filename)
io.Copy(file, stream)

func (*Client) GetServices Uses

func (c *Client) GetServices(ctx context.Context, opt *ServicesListOptions) ([]*Service, *http.Response, error)

GetServices lists the services.

Code:

c := mirakurun.NewClient()

services, _, err := c.GetServices(context.Background(), nil)
if err != nil {
    log.Fatal(err)
}

for _, service := range services {
    fmt.Printf("%d: %s\n", service.ID, service.Name)
}

func (*Client) GetServicesByChannel Uses

func (c *Client) GetServicesByChannel(ctx context.Context, typ string, channel string) ([]*Service, *http.Response, error)

GetServicesByChannel lists the services for the specified channel.

Code:

c := mirakurun.NewClient()

services, _, err := c.GetServicesByChannel(context.Background(), "GR", "16")
if err != nil {
    log.Fatal(err)
}

for _, service := range services {
    fmt.Printf("%d: %s\n", service.ID, service.Name)
}

func (*Client) GetStatus Uses

func (c *Client) GetStatus(ctx context.Context) (*Status, *http.Response, error)

GetStatus fetches a status.

Code:

c := mirakurun.NewClient()

status, _, err := c.GetStatus(context.Background())
if err != nil {
    log.Fatal(err)
}

fmt.Println("Version: " + status.Version)

func (*Client) GetTuner Uses

func (c *Client) GetTuner(ctx context.Context, index int) (*TunerDevice, *http.Response, error)

GetTuner fetches a tuner.

Code:

c := mirakurun.NewClient()

tuner, _, err := c.GetTuner(context.Background(), 1)
if err != nil {
    log.Fatal(err)
}

fmt.Printf("%d: %s (%s)\n", tuner.Index, tuner.Name, strings.Join(tuner.Types, ", "))

func (*Client) GetTunerProcess Uses

func (c *Client) GetTunerProcess(ctx context.Context, index int) (*TunerProcess, *http.Response, error)

GetTunerProcess fetches a tuner process.

Code:

c := mirakurun.NewClient()

process, _, err := c.GetTunerProcess(context.Background(), 1)
if err != nil {
    log.Fatal(err)
}

fmt.Println("PID: ", process.PID)

func (*Client) GetTuners Uses

func (c *Client) GetTuners(ctx context.Context) ([]*TunerDevice, *http.Response, error)

GetTuners lists the tuners.

Code:

c := mirakurun.NewClient()

tuners, _, err := c.GetTuners(context.Background())
if err != nil {
    log.Fatal(err)
}

for _, tuner := range tuners {
    fmt.Printf("%d: %s (%s)\n", tuner.Index, tuner.Name, strings.Join(tuner.Types, ", "))
}

func (*Client) GetTunersConfig Uses

func (c *Client) GetTunersConfig(ctx context.Context) (TunersConfig, *http.Response, error)

GetTunersConfig fetches a tuners config.

Code:

c := mirakurun.NewClient()

config, _, err := c.GetTunersConfig(context.Background())
if err != nil {
    log.Fatal(err)
}

for _, cItem := range config {
    fmt.Printf("%s: %v\n", cItem.Name, cItem.IsDisabled)
}

func (*Client) KillTunerProcess Uses

func (c *Client) KillTunerProcess(ctx context.Context, index int) (*TunerProcess, *http.Response, error)

KillTunerProcess kills a tuner process.

Code:

c := mirakurun.NewClient()

process, _, err := c.KillTunerProcess(context.Background(), 1)
if err != nil {
    log.Fatal(err)
}

fmt.Println("PID: ", process.PID)

func (*Client) NewRequest Uses

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request.

func (*Client) Restart Uses

func (c *Client) Restart(ctx context.Context) (*RestartResponse, *http.Response, error)

Restart a Mirakurun process.

Code:

c := mirakurun.NewClient()

restart, _, err := c.Restart(context.Background())
if err != nil {
    log.Fatal(err)
}

fmt.Println("PID: ", restart.PID)

func (*Client) UpdateChannelsConfig Uses

func (c *Client) UpdateChannelsConfig(ctx context.Context, body ChannelsConfig) (ChannelsConfig, *http.Response, error)

UpdateChannelsConfig updates a channels config.

Code:

c := mirakurun.NewClient()

body := mirakurun.ChannelsConfig{
    &mirakurun.ChannelConfig{Name: "Test Channel", Type: "GR", Channel: "16"},
}
config, _, err := c.UpdateChannelsConfig(context.Background(), body)
if err != nil {
    log.Fatal(err)
}

for _, cItem := range config {
    fmt.Printf("%s: %v\n", cItem.Name, cItem.IsDisabled)
}

func (*Client) UpdateServerConfig Uses

func (c *Client) UpdateServerConfig(ctx context.Context, body *ServerConfig) (*ServerConfig, *http.Response, error)

UpdateServerConfig updates a server config.

Code:

c := mirakurun.NewClient()

body := &mirakurun.ServerConfig{Port: 14772}
config, _, err := c.UpdateServerConfig(context.Background(), body)
if err != nil {
    log.Fatal(err)
}

fmt.Printf(":%d%s\n", config.Port, config.Path)

func (*Client) UpdateTunersConfig Uses

func (c *Client) UpdateTunersConfig(ctx context.Context, body TunersConfig) (TunersConfig, *http.Response, error)

UpdateTunersConfig updates a tuners config.

Code:

c := mirakurun.NewClient()

body := mirakurun.TunersConfig{
    &mirakurun.TunerConfig{Name: "Test Tuner", Types: []string{"BS", "CS"}},
}
config, _, err := c.UpdateTunersConfig(context.Background(), body)
if err != nil {
    log.Fatal(err)
}

for _, cItem := range config {
    fmt.Printf("%s: %v\n", cItem.Name, cItem.IsDisabled)
}

func (*Client) UpdateVersion Uses

func (c *Client) UpdateVersion(ctx context.Context, opt *VersionUpdateOptions) (io.ReadCloser, *http.Response, error)

UpdateVersion updates a Mirakurun version.

Code:

c := mirakurun.NewClient()

stream, _, err := c.UpdateVersion(context.Background(), nil)
if err != nil {
    log.Fatal(err)
}
defer stream.Close()

io.Copy(os.Stdout, stream)

type DecodeOptions Uses

type DecodeOptions struct {
    Decode int `url:"decode,omitempty"`
}

DecodeOptions specifies the optional parameters to various Stream method that support decoding.

type EPGStatus Uses

type EPGStatus struct {
    GatheringNetworks []int `json:"gatheringNetworks"`
    StoredEvents      int   `json:"storedEvents"`
}

EPGStatus represents a Mirakurun EPG status.

type Event Uses

type Event struct {
    Resource string      `json:"resource"`
    Type     string      `json:"type"`
    Data     interface{} `json:"data"`
    Time     Timestamp   `json:"time"`
}

Event represents a Mirakurun event.

type EventsListOptions Uses

type EventsListOptions struct {
    Resource string `url:"resource,omitempty"`
    Type     string `url:"type,omitempty"`
}

EventsListOptions specifies the optional parameters to the Client.GetEventsStream method.

type ProcessStatus Uses

type ProcessStatus struct {
    Arch        string            `json:"arch"`
    Platform    string            `json:"platform"`
    Versions    map[string]string `json:"versions"`
    PID         int               `json:"pid"`
    MemoryUsage map[string]int    `json:"memoryUsage"`
}

ProcessStatus represents a Mirakurun process status.

type Program Uses

type Program struct {
    ID        int       `json:"id"`
    EventID   int       `json:"eventId"`
    ServiceID int       `json:"serviceId"`
    NetworkID int       `json:"networkId"`
    StartAt   Timestamp `json:"startAt"`
    Duration  int       `json:"duration"`
    IsFree    bool      `json:"isFree"`

    Name        string         `json:"name,omitempty"`
    Description string         `json:"description,omitempty"`
    Genres      []ProgramGenre `json:"genres,omitempty"`
    Video       ProgramVideo   `json:"video,omitempty"`
    Audio       ProgramAudio   `json:"audio,omitempty"`

    Series ProgramSeries `json:"series,omitempty"`

    Extended map[string]string `json:"extended,omitempty"`

    RelatedItems []ProgramRelatedItem `json:"relatedItems,omitempty"`
}

Program represents a Mirakurun program.

type ProgramAudio Uses

type ProgramAudio struct {
    SamplingRate  int `json:"samplingRate"`
    ComponentType int `json:"componentType"`
}

ProgramAudio represents a Mirakurun program audio.

type ProgramGenre Uses

type ProgramGenre struct {
    Level1      int `json:"lv1"`
    Level2      int `json:"lv2"`
    UserNibble1 int `json:"un1"`
    UserNibble2 int `json:"un2"`
}

ProgramGenre represents a Mirakurun program genre.

type ProgramRelatedItem Uses

type ProgramRelatedItem struct {
    NetworkID int `json:"networkId"`
    ServiceID int `json:"serviceId"`
    EventID   int `json:"eventId"`
}

ProgramRelatedItem represents a Mirakurun program related item.

type ProgramSeries Uses

type ProgramSeries struct {
    ID          int       `json:"id"`
    Repeat      int       `json:"repeat"`
    Pattern     int       `json:"pattern"`
    ExpiresAt   Timestamp `json:"expiresAt"`
    Episode     int       `json:"episode"`
    LastEpisode int       `json:"lastEpisode"`
    Name        string    `json:"name"`
}

ProgramSeries represents a Mirakurun program series.

type ProgramVideo Uses

type ProgramVideo struct {
    Type       string `json:"type"`
    Resolution string `json:"resolution"`

    StreamContent int `json:"streamContent"`
    ComponentType int `json:"componentType"`
}

ProgramVideo represents a Mirakurun program video.

type ProgramsListOptions Uses

type ProgramsListOptions struct {
    NetworkID int `url:"networkId,omitempty"`
    ServiceID int `url:"serviceId,omitempty"`
    EventID   int `url:"eventId,omitempty"`
}

ProgramsListOptions ...

type RestartResponse Uses

type RestartResponse struct {
    PID int `json:"_cmd_pid"`
}

RestartResponse represents a Mirakurun restart response.

type ServerConfig Uses

type ServerConfig struct {
    Path                      string `json:"path,omitempty"`
    Port                      int    `json:"port,omitempty"`
    DisableIPv6               bool   `json:"disableIPv6,omitempty"`
    LogLevel                  int    `json:"logLevel,omitempty"`
    MaxLogHistory             int    `json:"maxLogHistory,omitempty"`
    HighWaterMark             int    `json:"highWaterMark,omitempty"`
    OverflowTimeLimit         int    `json:"overflowTimeLimit,omitempty"`
    MaxBufferBytesBeforeReady int    `json:"maxBufferBytesBeforeReady,omitempty"`
    EventEndTimeout           int    `json:"eventEndTimeout,omitempty"`
    ProgramGCInterval         int    `json:"programGCInterval,omitempty"`
    EPGGatheringInterval      int    `json:"epgGatheringInterval,omitempty"`
    EPGRetrievalTime          int    `json:"epgRetrievalTime,omitempty"`
}

ServerConfig represents a Mirakurun server config.

type Service Uses

type Service struct {
    ID                 int     `json:"id"`
    ServiceID          int     `json:"serviceId"`
    NetworkID          int     `json:"networkId"`
    Name               string  `json:"name"`
    LogoID             int     `json:"logoId,omitempty"`
    HasLogoData        bool    `json:"hasLogoData,omitempty"`
    RemoteControlKeyID int     `json:"remoteControlKeyId,omitempty"`
    Channel            Channel `json:"channel,omitempty"`
}

Service represents a Mirakurun service.

type ServicesListOptions Uses

type ServicesListOptions struct {
    ServiceID   int    `url:"serviceId,omitempty"`
    NetworkID   int    `url:"networkId,omitempty"`
    Name        string `url:"name,omitempty"`
    Type        int    `url:"type,omitempty"`
    ChannelType string `url:"channel.type,omitempty"`
    Channel     string `url:"channel.channel,omitempty"`
}

ServicesListOptions specifies the optional parameters to the Client.GetServices method.

type Status Uses

type Status struct {
    Version       string              `json:"version"`
    Process       ProcessStatus       `json:"process"`
    EPG           EPGStatus           `json:"epg"`
    StreamCount   map[string]int      `json:"streamCount"`
    ErrorCount    map[string]int      `json:"errorCount"`
    TimerAccuracy TimerAccuracyStatus `json:"timerAccuracy"`
}

Status represents a Mirakurun status.

type TimerAccuracyStatus Uses

type TimerAccuracyStatus struct {
    Last float64            `json:"last"`
    M1   map[string]float64 `json:"m1"`
    M5   map[string]float64 `json:"m5"`
    M15  map[string]float64 `json:"m15"`
}

TimerAccuracyStatus represents a Mirakurun time accuracy status.

type Timestamp Uses

type Timestamp struct {
    time.Time
}

Timestamp represents a Mirakurun timestamp.

func (*Timestamp) UnmarshalJSON Uses

func (t *Timestamp) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type TunerConfig Uses

type TunerConfig struct {
    Name          string   `json:"name"`
    Types         []string `json:"types"`
    Command       string   `json:"command,omitempty"`
    DVBDevicePath string   `json:"dvbDevicePath,omitempty"`
    Decoder       string   `json:"decoder,omitempty"`
    IsDisabled    bool     `json:"isDisabled,omitempty"`
}

TunerConfig represents a Mirakurun tuner config.

type TunerDevice Uses

type TunerDevice struct {
    Index       int         `json:"index"`
    Name        string      `json:"name"`
    Types       []string    `json:"types"`
    Command     string      `json:"command"`
    PID         int         `json:"pid"`
    Users       []TunerUser `json:"users"`
    IsAvailable bool        `json:"isAvailable"`
    IsFree      bool        `json:"isFree"`
    IsUsing     bool        `json:"isUsing"`
    IsFault     bool        `json:"isFault"`
}

TunerDevice represents a Mirakurun tuner device.

type TunerProcess Uses

type TunerProcess struct {
    PID int `json:"pid"`
}

TunerProcess represents a Mirakurun tuner process.

type TunerUser Uses

type TunerUser struct {
    ID       string `json:"id"`
    Priority int    `json:"priority"`
    Agent    string `json:"agent,omitempty"`
}

TunerUser represents a Mirakurun tuner user.

type TunersConfig Uses

type TunersConfig []*TunerConfig

TunersConfig represents a Mirakurun tuners config.

type Version Uses

type Version struct {
    Current string `json:"current"`
    Latest  string `json:"latest"`
}

Version represents a Mirakurun version.

type VersionUpdateOptions Uses

type VersionUpdateOptions struct {
    Force bool `url:"force,omitempty"`
}

VersionUpdateOptions specifies the optional parameters to the Client.UpdateVersion method.

Package mirakurun imports 11 packages (graph). Updated 2018-07-20. Refresh now. Tools for package owners.