dlna

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(key interface{}, value interface{})
	Get(key interface{}) (value interface{}, ok bool)
}

type Config

type Config interface {
	GetDLNAInterfaces() []string
	GetDLNAServerName() string
	GetDLNADefaultIPWhitelist() []string
	GetVideoSortOrder() string
}

type Dlnaip added in v0.17.0

type Dlnaip struct {
	IPAddress string `json:"ipAddress"`
	// Time until IP will be no longer allowed/disallowed
	Until *time.Time `json:"until"`
}

type Icon

type Icon struct {
	Width, Height, Depth int
	Mimetype             string
	io.ReadSeeker
}

type MovieFinder added in v0.17.0

type MovieFinder interface {
	All(ctx context.Context) ([]*models.Movie, error)
}

type PerformerFinder added in v0.17.0

type PerformerFinder interface {
	All(ctx context.Context) ([]*models.Performer, error)
}

type Repository added in v0.17.0

type Repository struct {
	TxnManager models.TxnManager

	SceneFinder     SceneFinder
	FileGetter      models.FileGetter
	StudioFinder    StudioFinder
	TagFinder       TagFinder
	PerformerFinder PerformerFinder
	MovieFinder     MovieFinder
}

func NewRepository added in v0.24.0

func NewRepository(repo models.Repository) Repository

func (*Repository) WithReadTxn added in v0.24.0

func (r *Repository) WithReadTxn(ctx context.Context, fn txn.TxnFunc) error

type SceneFinder added in v0.17.0

type SceneFinder interface {
	models.SceneGetter
	models.SceneQueryer
}

type Server

type Server struct {
	HTTPConn     net.Listener
	FriendlyName string
	Interfaces   []net.Interface

	RootObjectPath string

	LogHeaders bool
	Icons      []Icon
	// Stall event subscription requests until they drop. A workaround for
	// some bad clients.
	StallEventSubscribe bool
	// Time interval between SSPD announces
	NotifyInterval time.Duration

	VideoSortOrder string
	// contains filtered or unexported fields
}

func (*Server) Close

func (me *Server) Close() (err error)

func (*Server) Serve

func (me *Server) Serve() (err error)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(repo Repository, cfg Config, sceneServer sceneServer) *Service

NewService initialises and returns a new DLNA service.

func (*Service) AddTempDLNAIP

func (s *Service) AddTempDLNAIP(pattern string, duration *time.Duration)

func (*Service) IsRunning

func (s *Service) IsRunning() bool

IsRunning returns true if the DLNA service is running.

func (*Service) RemoveTempDLNAIP

func (s *Service) RemoveTempDLNAIP(pattern string) bool

func (*Service) Start

func (s *Service) Start(duration *time.Duration) error

Start starts the DLNA service. If duration is provided, then the service is stopped after the duration has elapsed.

func (*Service) Status

func (s *Service) Status() *Status

func (*Service) Stop

func (s *Service) Stop(duration *time.Duration)

Stop stops the DLNA service. If duration is provided, then the service is started after the duration has elapsed.

type Status added in v0.17.0

type Status struct {
	Running bool `json:"running"`
	// If not currently running, time until it will be started. If running, time until it will be stopped
	Until              *time.Time `json:"until"`
	RecentIPAddresses  []string   `json:"recentIPAddresses"`
	AllowedIPAddresses []*Dlnaip  `json:"allowedIPAddresses"`
}

type StudioFinder added in v0.17.0

type StudioFinder interface {
	All(ctx context.Context) ([]*models.Studio, error)
}

type TagFinder added in v0.17.0

type TagFinder interface {
	All(ctx context.Context) ([]*models.Tag, error)
}

type UPnPService

type UPnPService interface {
	Handle(action string, argsXML []byte, r *http.Request) (respArgs map[string]string, err error)
	Subscribe(callback []*url.URL, timeoutSeconds int) (sid string, actualTimeout int, err error)
	Unsubscribe(sid string) error
}

UPnP SOAP service.

Jump to

Keyboard shortcuts

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