natweb

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

	Domain  string `json:"domain"`   // 域名
	ExtPort uint   `json:"ext_port"` // 外部端口(80)
	IntPort uint   `json:"int_port"` // 内部端口(0-65535)
}

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,domain,ext_port,int_port)
	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"`
		Domain  string `json:"domain"`
		ExtPort uint   `json:"ext_port"`
		IntPort uint   `json:"int_port"`
	} `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