internal

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: BSD-3-Clause Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReloadInterval = getEnvAsDuration("NP_RELOAD_INTERVAL", 1*time.Hour)
)

Functions

func NewTLSConfig added in v1.15.0

func NewTLSConfig() (*tls.Config, error)

Types

type Client

type Client struct{ Common }

func NewClient

func NewClient(parsedURL *url.URL, logger *logs.Logger) (*Client, error)

func (*Client) Run

func (c *Client) Run()

type Common

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

type Instance

type Instance struct {
	ID         string `json:"id"`
	Alias      string `json:"alias"`
	Type       string `json:"type"`
	Status     string `json:"status"`
	URL        string `json:"url"`
	Config     string `json:"config"`
	Restart    bool   `json:"restart"`
	Meta       Meta   `json:"meta"`
	Mode       int32  `json:"mode"`
	Ping       int32  `json:"ping"`
	Pool       int32  `json:"pool"`
	TCPS       int32  `json:"tcps"`
	UDPS       int32  `json:"udps"`
	TCPRX      uint64 `json:"tcprx"`
	TCPTX      uint64 `json:"tcptx"`
	UDPRX      uint64 `json:"udprx"`
	UDPTX      uint64 `json:"udptx"`
	TCPRXBase  uint64 `json:"-" gob:"-"`
	TCPTXBase  uint64 `json:"-" gob:"-"`
	UDPRXBase  uint64 `json:"-" gob:"-"`
	UDPTXBase  uint64 `json:"-" gob:"-"`
	TCPRXReset uint64 `json:"-" gob:"-"`
	TCPTXReset uint64 `json:"-" gob:"-"`
	UDPRXReset uint64 `json:"-" gob:"-"`
	UDPTXReset uint64 `json:"-" gob:"-"`
	// contains filtered or unexported fields
}

type InstanceEvent

type InstanceEvent struct {
	Type     string    `json:"type"`
	Time     time.Time `json:"time"`
	Instance *Instance `json:"instance"`
	Logs     string    `json:"logs"`
}

type InstanceLogWriter

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

func NewInstanceLogWriter

func NewInstanceLogWriter(instanceID string, instance *Instance, target io.Writer, master *Master) *InstanceLogWriter

func (*InstanceLogWriter) Write

func (w *InstanceLogWriter) Write(p []byte) (n int, err error)

type Master

type Master struct {
	Common
	// contains filtered or unexported fields
}

func NewMaster