daemon

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolHTTPS = "https"
	ProtocolTCP   = "tcp"
	ProtocolTLS   = "tls"
)

Variables

View Source
var (
	ConnectionStatusStatusOnline = ConnectionStatus("online")
	ConnectionStatusReconnecting = ConnectionStatus("reconnecting")
)

Functions

func Start

func Start()

Types

type Configuration added in v0.4.0

type Configuration struct {
	Name     string   `json:"name"`
	Protocol Protocol `json:"protocol"`
	Prefix   string   `json:"prefix"`
	Hostname string   `json:"hostname"`
	Domain   string   `json:"domain"`
	Port     int      `json:"port"`
}

type ConnectReply added in v0.4.0

type ConnectReply struct {
}

type ConnectRequest added in v0.4.0

type ConnectRequest struct {
	Name     string
	Address  string
	Protocol Protocol
}

type Connection added in v0.4.0

type Connection struct {
	Header        *Header
	ID            string `json:"id"`
	Name          string `json:"name"`
	Random        bool   `json:"random"`
	Hostname      string `json:"hostname"`
	Port          int    `json:"port"`
	TargetAddress string `json:"target_address"`
	RemoteHost    string
	RemotePort    int
	RemoteURI     string           `json:"remote_uri"`
	Status        ConnectionStatus `json:"status"`
	ConnectedAt   time.Time        `json:"connected_at"`
	Configuration *Configuration   `json:"-"`
	// contains filtered or unexported fields
}

func (*Connection) Host added in v0.4.0

func (c *Connection) Host() (host string)

type ConnectionStatus added in v0.4.0

type ConnectionStatus string

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}
type Header struct {
	ID     string `json:"id"`
	Key    string `json:"key"`
	Name   string `json:"name"`
	Target string `json:"target"`
	TLS    bool   `json:"tls"`
}

type PSReply

type PSReply struct {
	Connections []*Connection
}

type PSRequest

type PSRequest struct {
}

type Protocol

type Protocol string

type RMReply

type RMReply struct {
}

type RMRequest

type RMRequest struct {
	Name  string
	Force bool
}

type Server added in v0.4.0

type Server struct {
	Connections map[string]*Connection
	// contains filtered or unexported fields
}

func (*Server) Connect added in v0.4.0

func (s *Server) Connect(req *ConnectRequest, rep *ConnectReply) (err error)

func (*Server) PS added in v0.4.0

func (s *Server) PS(req *PSRequest, rep *PSReply) (err error)

func (*Server) RM added in v0.4.0

func (s *Server) RM(req *RMRequest, rep *RMReply) error

Jump to

Keyboard shortcuts

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