xtreamcodes

package
v0.0.0-...-9ba1955 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnauthorized        = errors.New("unauthenticated")
	ErrBadRequest          = errors.New("bad request")
	ErrInternalServerError = errors.New("internal server error")
)

Functions

This section is empty.

Types

type Action

type Action string
const (
	ActionVodMovieCategories  Action = "get_vod_categories"
	ActionVodMovieStreams     Action = "get_vod_streams"
	ActionVodSeriesCategories Action = "get_series_categories"
	ActionVodSeriesStreams    Action = "get_series"
	ActionLiveCategories      Action = "get_live_categories"
	ActionLiveStreams         Action = "get_live_streams"
	ActionGetVodInfo          Action = "get_vod_info"
	ActionNone                Action = ""
)

type ActionHandler

type ActionHandler interface {
	HandleAction(w http.ResponseWriter, r *http.Request) error
	Action() Action
}

type NoneActionHandler

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

func (*NoneActionHandler) Action

func (nah *NoneActionHandler) Action() Action

func (*NoneActionHandler) HandleAction

func (nah *NoneActionHandler) HandleAction(w http.ResponseWriter, r *http.Request) error

type NoneActionResponse

type NoneActionResponse struct {
	UserInfo   UserInfo   `json:"userInfo"`
	ServerInfo ServerInfo `json:"serverInfo"`
}

type ServerInfo

type ServerInfo struct {
	Version        string `json:"version"`
	URL            string `json:"url"`
	Port           string `json:"port"`
	HTTPSPort      string `json:"https_port"`
	ServerProtocol string `json:"server_protocol"`
	RtmpPort       string `json:"rtmp_port"`
	TimeNow        string `json:"time_now"`
	Timezone       string `json:"timezone"`
	Revision       int    `json:"revision"`
	TimestampNow   int    `json:"timestamp_now"`
	Xui            bool   `json:"xui"`
}

type ServerInfoFetcher

type ServerInfoFetcher interface {
	FetchServerInfo() (ServerInfo, error)
}

type Service

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

func NewService

func NewService(uf UserFetcher, sif ServerInfoFetcher) *Service

func (*Service) Handle

func (s *Service) Handle(w http.ResponseWriter, r *http.Request) error

type UserFetcher

type UserFetcher interface {
	FetchUser(username, password string) (UserInfo, error)
}

type UserInfo

type UserInfo struct {
	Username             string   `json:"username"`
	Password             string   `json:"password"`
	Message              string   `json:"message"`
	Status               string   `json:"status"`
	ExpDate              string   `json:"exp_date"`
	IsTrial              string   `json:"is_trial"`
	ActiveCons           string   `json:"activeCons"`
	CreatedAt            string   `json:"created_at"`
	MaxConnections       string   `json:"max_connections"`
	AllowedOutputFormats []string `json:"allowed_output_formats"`
	Auth                 int      `json:"auth"`
}

Jump to

Keyboard shortcuts

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