marzban

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Provider

func Provider() *schema.Provider

Types

type Client

type Client struct {
	BaseURL    string
	HTTPClient *http.Client
	Token      string
}

func NewClient

func NewClient(baseURL, token string) *Client

func (*Client) CreateNode

func (c *Client) CreateNode(name, address string, port, apiPort int, usageCoefficient float64, addAsNewHost bool) (int, error)

func (*Client) DeleteNode

func (c *Client) DeleteNode(nodeID string) error

func (*Client) GetNode

func (c *Client) GetNode(nodeID string) (*Node, error)

func (*Client) UpdateNode

func (c *Client) UpdateNode(nodeID, name, address string, port, apiPort int, usageCoefficient float64, addAsNewHost bool) error

type Node

type Node struct {
	Name             string  `json:"name"`
	Address          string  `json:"address"`
	Port             int     `json:"port"`
	ApiPort          int     `json:"api_port"`
	UsageCoefficient float64 `json:"usage_coefficient"`
	AddAsNewHost     bool    `json:"add_as_new_host"`
}

Jump to

Keyboard shortcuts

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