natacl

package
v0.0.1-beta3 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateReq

type CreateReq struct {
	ID uint `json:"-"` // 实例ID

	Name     string `json:"name"`     // 名称
	ExtPort  uint   `json:"ext_port"` // 外部端口(0-65535除开80/443/22)
	IntPort  uint   `json:"int_port"` // 内部端口(0-65535)
	Protocol uint   `json:"protocol"` // 协议(1tcp,2udp,3tcp+udp)
}

func (*CreateReq) Body

func (r *CreateReq) Body() any

func (*CreateReq) Form

func (r *CreateReq) Form() (form url.Values)

func (*CreateReq) Header

func (r *CreateReq) Header() http.Header

func (*CreateReq) Method

func (r *CreateReq) Method() string

func (*CreateReq) Url

func (r *CreateReq) Url() string

func (*CreateReq) Values

func (r *CreateReq) Values() (values url.Values)

type CreateResp

type CreateResp struct{}

func Create

func Create(ctx *cloudplatform.Context, req *CreateReq) (*CreateResp, error)

Create 添加NAT转发

type DeleteReq

type DeleteReq struct {
	ID     uint `url:"-"`                // NAT转发ID
	HostID uint `url:"hostid,omitempty"` // 验证是否属于某个实例
}

func (*DeleteReq) Body

func (r *DeleteReq) Body() any

func (*DeleteReq) Form

func (r *DeleteReq) Form() (form url.Values)

func (*DeleteReq) Header

func (r *DeleteReq) Header() http.Header

func (*DeleteReq) Method

func (r *DeleteReq) Method() string

func (*DeleteReq) Url

func (r *DeleteReq) Url() string

func (*DeleteReq) Values

func (r *DeleteReq) Values() (values url.Values)

type DeleteResp

type DeleteResp struct{}

func Delete

func Delete(ctx *cloudplatform.Context, req *DeleteReq) (*DeleteResp, error)

Delete 删除NAT转发

type ListReq

type ListReq struct {
	ID       uint   `url:"-"`                   // 实例ID
	Search   string `url:"search,omitempty"`    // 搜索
	ListType string `url:"list_type,omitempty"` // 获取类型(all,page),all会忽略页数直接返回所有

	Page    string `url:"page,omitempty"`
	PerPage string `url:"per_page,omitempty"`
	Orderby string `url:"orderby,omitempty"` // 排序(id,name,ext_port,int_port,protocol)
	Sort    string `url:"sort,omitempty"`
}

func (*ListReq) Body

func (r *ListReq) Body() any

func (*ListReq) Form

func (r *ListReq) Form() (form url.Values)

func (*ListReq) Header

func (r *ListReq) Header() http.Header

func (*ListReq) Method

func (r *ListReq) Method() string

func (*ListReq) Url

func (r *ListReq) Url() string

func (*ListReq) Values

func (r *ListReq) Values() (values url.Values)

type ListResp

type ListResp struct {
	NatHostIp string `json:"nat_host_ip"`
	Data      []struct {
		ID       uint   `json:"id"`
		Name     string `json:"name"`
		ExtPort  uint   `json:"ext_port"`
		IntPort  uint   `json:"int_port"`
		Protocol uint   `json:"protocol"`
	} `json:"data"`
	Meta struct {
		Total     int `json:"total"`
		TotalPage int `json:"total_page"`
		Page      int `json:"page"`
		PerPage   int `json:"per_page"`
	} `json:"meta"`
}

func List

func List(ctx *cloudplatform.Context, req *ListReq) (*ListResp, error)

List NAT转发列表

Jump to

Keyboard shortcuts

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