server

package
v0.0.0-...-f0d068a Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MDNSService = "_arcast._http._tcp"
	MDNSDomain  = "local."
)

Variables

This section is empty.

Functions

func NewRandomInstanceID

func NewRandomInstanceID() string

Types

type App

type App struct {
	ID          string            `json:"id"`
	Title       map[string]string `json:"title"`
	Description map[string]string `json:"description"`
	Icon        string            `json:"icon"`
	FS          fs.FS             `json:"-"`
	Hidden      bool              `json:"hidden"`
}

type CastRequest

type CastRequest struct {
	URL string `json:"url" validate:"required"`
}

type InfoResponse

type InfoResponse struct {
	IPs                     []string `json:"ips"`
	Port                    int      `json:"port"`
	TLSPort                 int      `json:"tlsPort"`
	InstanceID              string   `json:"instanceId"`
	AppsEnabled             bool     `json:"appsEnabled"`
	ServiceDiscoveryEnabled bool     `json:"serviceDiscoveryEnabled"`
}

type OptionFunc

type OptionFunc func(opts *Options)

func WithAddress

func WithAddress(addr string) OptionFunc

func WithAllowedOrigins

func WithAllowedOrigins(origins ...string) OptionFunc

func WithApps

func WithApps(apps ...App) OptionFunc

func WithAppsEnabled

func WithAppsEnabled(enabled bool) OptionFunc

func WithDefaultApp

func WithDefaultApp(defaultApp string) OptionFunc

func WithInstanceID

func WithInstanceID(id string) OptionFunc

func WithServiceDiscoveryEnabled

func WithServiceDiscoveryEnabled(enabled bool) OptionFunc

func WithTLSAddress

func WithTLSAddress(addr string) OptionFunc

func WithTLSCertificate

func WithTLSCertificate(cert *tls.Certificate) OptionFunc

func WithUpperLayerDir

func WithUpperLayerDir(dir string) OptionFunc

type Options

type Options struct {
	InstanceID             string
	Address                string
	TLSAddress             string
	TLSCertificate         *tls.Certificate
	EnableServiceDiscovery bool
	EnableApps             bool
	DefaultApp             string
	AllowedOrigins         []string
	Apps                   []App
	UpperLayerDir          string
}

func NewOptions

func NewOptions(funcs ...OptionFunc) *Options

type Server

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

func New

func New(browser browser.Browser, funcs ...OptionFunc) *Server

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

func (*Server) Wait

func (s *Server) Wait() error

type StatusResponse

type StatusResponse struct {
	ID     string `json:"id"`
	URL    string `json:"url"`
	Status string `json:"status"`
	Title  string `json:"title"`
}

Jump to

Keyboard shortcuts

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