Documentation
¶
Index ¶
- type ChildCreateRequest
- type ChildCreateResponse
- type Client
- func (c *Client) ChildCreate(ctx context.Context, req *ChildCreateRequest) (*ChildCreateResponse, error)
- func (c *Client) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error)
- func (c *Client) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error)
- func (c *Client) DeleteRulePos(ctx context.Context, req *DeleteRulePosRequest) (*DeleteRulePosResponse, error)
- func (c *Client) Find(ctx context.Context, req *FindRequest) (*FindResponse, error)
- func (c *Client) GetRulePos(ctx context.Context, req *GetRulePosRequest) (*GetRulePosResponse, error)
- func (c *Client) Index(ctx context.Context) (*IndexResponse, error)
- func (c *Client) UpdateRulePos(ctx context.Context, req *UpdateRulePosRequest) (*UpdateRulePosResponse, error)
- type CreateRequest
- type CreateResponse
- type DeleteRequest
- type DeleteResponse
- type DeleteRulePosRequest
- type DeleteRulePosResponse
- type FindRequest
- type FindResponse
- type GetRulePosRequest
- type GetRulePosResponse
- type HTTPClient
- type IndexResponse
- type UpdateRulePosRequest
- type UpdateRulePosResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChildCreateRequest ¶
type ChildCreateRequest struct {
Action string `url:"action",json:"action"` // Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name.
Group string `url:"group",json:"group"` // Security Group name.
Type string `url:"type",json:"type"` // Rule type.
// The following parameters are optional
Comment *string `url:"comment,omitempty",json:"comment,omitempty"` // Descriptive comment.
Dest *string `url:"dest,omitempty",json:"dest,omitempty"` // Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists.
Digest *string `url:"digest,omitempty",json:"digest,omitempty"` // Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
Dport *string `url:"dport,omitempty",json:"dport,omitempty"` // Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges.
Enable *int `url:"enable,omitempty",json:"enable,omitempty"` // Flag to enable/disable a rule.
IcmpType *string `url:"icmp-type,omitempty",json:"icmp-type,omitempty"` // Specify icmp-type. Only valid if proto equals 'icmp'.
Iface *string `url:"iface,omitempty",json:"iface,omitempty"` // Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings.
Log *string `url:"log,omitempty",json:"log,omitempty"` // Log level for firewall rule.
Macro *string `url:"macro,omitempty",json:"macro,omitempty"` // Use predefined standard macro.
Pos *int `url:"pos,omitempty",json:"pos,omitempty"` // Update rule at position <pos>.
Proto *string `url:"proto,omitempty",json:"proto,omitempty"` // IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'.
Source *string `url:"source,omitempty",json:"source,omitempty"` // Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists.
Sport *string `url:"sport,omitempty",json:"sport,omitempty"` // Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges.
}
type ChildCreateResponse ¶
type ChildCreateResponse map[string]interface{}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(c HTTPClient) *Client
func (*Client) ChildCreate ¶
func (c *Client) ChildCreate(ctx context.Context, req *ChildCreateRequest) (*ChildCreateResponse, error)
ChildCreate Create new rule.
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error)
Create Create new security group.
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error)
Delete Delete security group.
func (*Client) DeleteRulePos ¶
func (c *Client) DeleteRulePos(ctx context.Context, req *DeleteRulePosRequest) (*DeleteRulePosResponse, error)
DeleteRulePos Delete rule.
func (*Client) Find ¶
func (c *Client) Find(ctx context.Context, req *FindRequest) (*FindResponse, error)
Find List rules.
func (*Client) GetRulePos ¶
func (c *Client) GetRulePos(ctx context.Context, req *GetRulePosRequest) (*GetRulePosResponse, error)
GetRulePos Get single rule data.
func (*Client) Index ¶
func (c *Client) Index(ctx context.Context) (*IndexResponse, error)
Index List security groups.
func (*Client) UpdateRulePos ¶
func (c *Client) UpdateRulePos(ctx context.Context, req *UpdateRulePosRequest) (*UpdateRulePosResponse, error)
UpdateRulePos Modify rule data.
type CreateRequest ¶
type CreateRequest struct {
Group string `url:"group",json:"group"` // Security Group name.
// The following parameters are optional
Comment *string `url:"comment,omitempty",json:"comment,omitempty"`
Digest *string `url:"digest,omitempty",json:"digest,omitempty"` // Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
Rename *string `url:"rename,omitempty",json:"rename,omitempty"` // Rename/update an existing security group. You can set 'rename' to the same value as 'name' to update the 'comment' of an existing group.
}
type CreateResponse ¶
type CreateResponse map[string]interface{}
type DeleteRequest ¶
type DeleteRequest struct {
Group string `url:"group",json:"group"` // Security Group name.
}
type DeleteResponse ¶
type DeleteResponse map[string]interface{}
type DeleteRulePosRequest ¶
type DeleteRulePosRequest struct {
Group string `url:"group",json:"group"` // Security Group name.
// The following parameters are optional
Digest *string `url:"digest,omitempty",json:"digest,omitempty"` // Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
Pos *int `url:"pos,omitempty",json:"pos,omitempty"` // Update rule at position <pos>.
}
type DeleteRulePosResponse ¶
type DeleteRulePosResponse map[string]interface{}
type FindRequest ¶
type FindRequest struct {
Group string `url:"group",json:"group"` // Security Group name.
}
type FindResponse ¶
type FindResponse []*struct {
Pos int `url:"pos",json:"pos"`
}
type GetRulePosRequest ¶
type GetRulePosResponse ¶
type GetRulePosResponse struct {
Action string `url:"action",json:"action"`
Pos int `url:"pos",json:"pos"`
Type string `url:"type",json:"type"`
// The following parameters are optional
Comment *string `url:"comment,omitempty",json:"comment,omitempty"`
Dest *string `url:"dest,omitempty",json:"dest,omitempty"`
Dport *string `url:"dport,omitempty",json:"dport,omitempty"`
Enable *int `url:"enable,omitempty",json:"enable,omitempty"`
IcmpType *string `url:"icmp-type,omitempty",json:"icmp-type,omitempty"`
Iface *string `url:"iface,omitempty",json:"iface,omitempty"`
Ipversion *int `url:"ipversion,omitempty",json:"ipversion,omitempty"`
Log *string `url:"log,omitempty",json:"log,omitempty"` // Log level for firewall rule
Macro *string `url:"macro,omitempty",json:"macro,omitempty"`
Proto *string `url:"proto,omitempty",json:"proto,omitempty"`
Source *string `url:"source,omitempty",json:"source,omitempty"`
Sport *string `url:"sport,omitempty",json:"sport,omitempty"`
}
type HTTPClient ¶
type IndexResponse ¶
type IndexResponse []*struct {
Digest string `url:"digest",json:"digest"` // Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
Group string `url:"group",json:"group"` // Security Group name.
// The following parameters are optional
Comment *string `url:"comment,omitempty",json:"comment,omitempty"`
}
type UpdateRulePosRequest ¶
type UpdateRulePosRequest struct {
Group string `url:"group",json:"group"` // Security Group name.
// The following parameters are optional
Action *string `url:"action,omitempty",json:"action,omitempty"` // Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name.
Comment *string `url:"comment,omitempty",json:"comment,omitempty"` // Descriptive comment.
Delete *string `url:"delete,omitempty",json:"delete,omitempty"` // A list of settings you want to delete.
Dest *string `url:"dest,omitempty",json:"dest,omitempty"` // Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists.
Digest *string `url:"digest,omitempty",json:"digest,omitempty"` // Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
Dport *string `url:"dport,omitempty",json:"dport,omitempty"` // Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges.
Enable *int `url:"enable,omitempty",json:"enable,omitempty"` // Flag to enable/disable a rule.
IcmpType *string `url:"icmp-type,omitempty",json:"icmp-type,omitempty"` // Specify icmp-type. Only valid if proto equals 'icmp'.
Iface *string `url:"iface,omitempty",json:"iface,omitempty"` // Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings.
Log *string `url:"log,omitempty",json:"log,omitempty"` // Log level for firewall rule.
Macro *string `url:"macro,omitempty",json:"macro,omitempty"` // Use predefined standard macro.
Moveto *int `url:"moveto,omitempty",json:"moveto,omitempty"` // Move rule to new position <moveto>. Other arguments are ignored.
Pos *int `url:"pos,omitempty",json:"pos,omitempty"` // Update rule at position <pos>.
Proto *string `url:"proto,omitempty",json:"proto,omitempty"` // IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'.
Source *string `url:"source,omitempty",json:"source,omitempty"` // Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists.
Sport *string `url:"sport,omitempty",json:"sport,omitempty"` // Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges.
Type *string `url:"type,omitempty",json:"type,omitempty"` // Rule type.
}
type UpdateRulePosResponse ¶
type UpdateRulePosResponse map[string]interface{}
Click to show internal directories.
Click to hide internal directories.