api

package
v0.67.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller handles HTTP API requests for frpc.

func NewController

func NewController(params ControllerParams) *Controller

NewController creates a new Controller.

func (*Controller) GetConfig

func (c *Controller) GetConfig(ctx *httppkg.Context) (any, error)

GetConfig handles GET /api/config

func (*Controller) PutConfig

func (c *Controller) PutConfig(ctx *httppkg.Context) (any, error)

PutConfig handles PUT /api/config

func (*Controller) Reload

func (c *Controller) Reload(ctx *httppkg.Context) (any, error)

Reload handles GET /api/reload

func (*Controller) Status

func (c *Controller) Status(ctx *httppkg.Context) (any, error)

Status handles GET /api/status

func (*Controller) Stop

func (c *Controller) Stop(ctx *httppkg.Context) (any, error)

Stop handles POST /api/stop

type ControllerParams

type ControllerParams struct {
	GetProxyStatus func() []*proxy.WorkingStatus
	ServerAddr     string
	ConfigFilePath string
	UnsafeFeatures *security.UnsafeFeatures
	UpdateConfig   func(proxyCfgs []v1.ProxyConfigurer, visitorCfgs []v1.VisitorConfigurer) error
	GracefulClose  func(d time.Duration)
}

ControllerParams contains parameters for creating an APIController.

type ProxyStatusResp

type ProxyStatusResp struct {
	Name       string `json:"name"`
	Type       string `json:"type"`
	Status     string `json:"status"`
	Err        string `json:"err"`
	LocalAddr  string `json:"local_addr"`
	Plugin     string `json:"plugin"`
	RemoteAddr string `json:"remote_addr"`
}

ProxyStatusResp contains proxy status information

type StatusResp

type StatusResp map[string][]ProxyStatusResp

StatusResp is the response for GET /api/status

Jump to

Keyboard shortcuts

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