srvinfo

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUrDecodRLInvalidPort        = errors.New("invalid port")
	ErrDecodeURLInvalidCredentials = errors.New("invalid credentials")
	ErrDecodeURLMissingPassword    = errors.New("missing password")
)

Functions

func MarshalCSV added in v0.9.0

func MarshalCSV(data OutlineServers) ([]byte, error)

func MarshalJSON added in v0.9.0

func MarshalJSON(data OutlineServers) ([]byte, error)

func MarshalTable added in v0.9.0

func MarshalTable(data OutlineServers) ([]byte, error)

func MarshalText added in v0.9.0

func MarshalText(data OutlineServers) ([]byte, error)

func MarshalYAML added in v0.9.0

func MarshalYAML(data OutlineServers) ([]byte, error)

Types

type OutlineServer

type OutlineServer struct {
	AccessKey  int       `json:"access_key" yaml:"access_key" csv:"access_key"`
	Location   string    `json:"location" yaml:"location" csv:"location"`
	Hosting    string    `json:"hosting" yaml:"hosting" csv:"hosting"`
	Quality    int       `json:"quality" yaml:"quality" csv:"quality"`
	Published  time.Time `json:"published" yaml:"published" csv:"published"`
	KeyType    string    `json:"key_type" yaml:"key_type" csv:"key_type"`
	PageURL    string    `json:"page_url" yaml:"page_url" csv:"page_url"`
	Link       string    `json:"ss_link" yaml:"ss_link" csv:"ss_link"`
	ServerInfo `json:"server_info" yaml:"server_info"`
}

OutlineServer is Outline server description.

func (*OutlineServer) Address

func (s *OutlineServer) Address() string

Address returns network address.

func (*OutlineServer) GetStatus

func (s *OutlineServer) GetStatus()

GetStatus checks server online status.

type OutlineServers

type OutlineServers []*OutlineServer

OutlineServers is Outline servers list.

func FetchData

func FetchData() (OutlineServers, error)

Run fetches Outline Community servers information.

func (OutlineServers) GetStatuses

func (ss OutlineServers) GetStatuses()

GetStatuses checks servers online status.

type ServerInfo

type ServerInfo struct {
	Host     string       `json:"host" yaml:"host" csv:"host"`
	Port     int          `json:"port" yaml:"port" csv:"port"`
	Cipher   string       `json:"cipher" yaml:"cipher" csv:"cipher"`
	Password string       `json:"password" yaml:"password" csv:"password"`
	Status   ServerStatus `json:"-" yaml:"-" csv:"-"`
}

ServerInfo a shadowsocks server information.

type ServerStatus

type ServerStatus string

ServerStatus status Outline server.

const (
	Unknown ServerStatus = "Unknown"
	Up      ServerStatus = "Up"
	Down    ServerStatus = "Down"
)

Jump to

Keyboard shortcuts

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