panel

package
v0.0.0-...-60dc3e1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoTls = 0
	Tls   = 1
)
View Source
const PluginName = "ratte-panel"

Variables

View Source
var HandshakeConfig = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "is-ratte-panel",
	MagicCookieValue: "true",
}

Functions

This section is empty.

Types

type AddRemoteParams

type AddRemoteParams struct {
	Baseurl  string
	NodeId   int
	NodeType string
	Key      string
	Timeout  int
	params.ExpandParams
}

type AddRemoteRsp

type AddRemoteRsp struct {
	RemoteId int
	Err      error
}

type GetNodeInfoRsp

type GetNodeInfoRsp struct {
	Hash     string
	NodeInfo NodeInfo
	Err      error
}

func (*GetNodeInfoRsp) GetHash

func (g *GetNodeInfoRsp) GetHash() string

type GetUserListRsp

type GetUserListRsp struct {
	Hash  string
	Users []UserInfo
	Err   error
}

func (*GetUserListRsp) GetHash

func (g *GetUserListRsp) GetHash() string

type NodeInfo

type NodeInfo params.NodeInfo

func (*NodeInfo) TlsType

func (i *NodeInfo) TlsType() int

type Panel

type Panel interface {
	AddRemote(params *AddRemoteParams) *AddRemoteRsp
	DelRemote(id int) error
	GetNodeInfo(id int) *GetNodeInfoRsp
	GetUserList(id int) *GetUserListRsp
	ReportUserTraffic(p *ReportUserTrafficParams) error
}

type Plugin

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

func NewPlugin

func NewPlugin(impl Panel) *Plugin

func (*Plugin) Client

func (_ *Plugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*Plugin) Server

func (p *Plugin) Server(*plugin.MuxBroker) (interface{}, error)

type PluginClient

type PluginClient struct {
	Panel
	*baseplugin.Client
}

func NewClient

func NewClient(l hclog.Logger, cmd *exec.Cmd) (client *PluginClient, err error)

func (*PluginClient) Close

func (c *PluginClient) Close() error

type PluginImplClient

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

func (*PluginImplClient) AddRemote

func (c *PluginImplClient) AddRemote(params *AddRemoteParams) (r *AddRemoteRsp)

func (*PluginImplClient) DelRemote

func (c *PluginImplClient) DelRemote(id int) error

func (*PluginImplClient) GetNodeInfo

func (c *PluginImplClient) GetNodeInfo(id int) (r *GetNodeInfoRsp)

func (*PluginImplClient) GetUserList

func (c *PluginImplClient) GetUserList(id int) (r *GetUserListRsp)

func (*PluginImplClient) ReportUserTraffic

func (c *PluginImplClient) ReportUserTraffic(p *ReportUserTrafficParams) (err error)

type PluginImplServer

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

func (*PluginImplServer) AddRemote

func (s *PluginImplServer) AddRemote(params *AddRemoteParams, r *AddRemoteRsp) error

func (*PluginImplServer) DelRemote

func (s *PluginImplServer) DelRemote(id int, _ any)

func (*PluginImplServer) GetNodeInfo

func (s *PluginImplServer) GetNodeInfo(id int, r *GetNodeInfoRsp) error

func (*PluginImplServer) GetUserList

func (s *PluginImplServer) GetUserList(id int, r *GetUserListRsp) error

func (*PluginImplServer) ReportUserTraffic

func (s *PluginImplServer) ReportUserTraffic(p *ReportUserTrafficParams, err *error) error

type PluginServer

type PluginServer struct {
	*baseplugin.Server
}

func NewServer

func NewServer(l hclog.Logger, p Panel) (*PluginServer, error)

type ReportUserTrafficParams

type ReportUserTrafficParams struct {
	Id    int
	Users []UserTrafficInfo
}

type UserInfo

type UserInfo struct {
	HashOrKey string
	params.UserInfo
}

func (*UserInfo) GetHashOrKey

func (u *UserInfo) GetHashOrKey() string

type UserTrafficInfo

type UserTrafficInfo struct {
	Id       int
	Name     string
	Upload   int64
	Download int64
}

Jump to

Keyboard shortcuts

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