Documentation
¶
Index ¶
- type APIClient
- func (c *APIClient) Block(ctx context.Context, req BlockRequest) ([]byte, error)
- func (c *APIClient) BlockIP(ctx context.Context, ipaddress string, dir string) error
- func (c *APIClient) Delete(ctx context.Context, endpoint string) ([]byte, error)
- func (c *APIClient) DeleteFirewallRule(ctx context.Context, id string) ([]byte, error)
- func (c *APIClient) FirewallList(ctx context.Context) (ResponseFirewallRules, error)
- func (c *APIClient) Get(ctx context.Context, endpoint string) ([]byte, error)
- func (c *APIClient) Login(ctx context.Context) error
- func (c *APIClient) Post(ctx context.Context, endpoint string, data interface{}) ([]byte, error)
- func (c *APIClient) UnBlockIP(ctx context.Context, ipaddress string, dir string) error
- type APIClientConfig
- type BlockRequest
- type FirewallRule
- type Meta
- type ResponseEnvelope
- type ResponseFirewallRules
- type ResponseMetaData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
func NewAPIClient ¶
func NewAPIClient(ctx context.Context, conf APIClientConfig) (*APIClient, error)
NewAPIClient returns an instance of APIClient
func (*APIClient) DeleteFirewallRule ¶ added in v0.0.3
func (*APIClient) FirewallList ¶
func (c *APIClient) FirewallList(ctx context.Context) (ResponseFirewallRules, error)
type APIClientConfig ¶
type BlockRequest ¶ added in v0.0.3
type BlockRequest struct { Name string `json:"name"` Interface string `json:"interface"` RuleLocation string `json:"location"` SrcAddress string `json:"src"` DstAddress string `json:"dst"` Protocol string `json:"protocol"` Action string `json:"action"` // contains filtered or unexported fields }
func (BlockRequest) AsFirewallRule ¶ added in v0.0.3
func (b BlockRequest) AsFirewallRule() FirewallRule
func (*BlockRequest) Description ¶ added in v0.0.3
func (b *BlockRequest) Description() (string, error)
func (*BlockRequest) Index ¶ added in v0.0.3
func (b *BlockRequest) Index() int
func (*BlockRequest) Validate ¶ added in v0.0.3
func (b *BlockRequest) Validate() error
type FirewallRule ¶ added in v0.0.3
type FirewallRule struct { ID string `json:"_id,omitempty"` Ruleset string `json:"ruleset"` RuleIndex int `json:"rule_index"` Name string `json:"name"` Enabled bool `json:"enabled"` Action string `json:"action"` ProtocolMatchExcepted bool `json:"protocol_match_excepted"` Logging bool `json:"logging"` StateNew bool `json:"state_new"` StateEstablished bool `json:"state_established"` StateInvalid bool `json:"state_invalid"` StateRelated bool `json:"state_related"` Ipsec string `json:"ipsec"` SrcFirewallgroupIds []string `json:"src_firewallgroup_ids"` SrcMacAddress string `json:"src_mac_address"` DstFirewallgroupIds []string `json:"dst_firewallgroup_ids"` DstAddress string `json:"dst_address"` SrcAddress string `json:"src_address"` Protocol string `json:"protocol"` IcmpTypename string `json:"icmp_typename"` SrcNetworkconfID string `json:"src_networkconf_id"` SrcNetworkconfType string `json:"src_networkconf_type"` DstNetworkconfID string `json:"dst_networkconf_id"` DstNetworkconfType string `json:"dst_networkconf_type"` SiteID string `json:"site_id"` }
type ResponseEnvelope ¶
type ResponseEnvelope struct { Meta ResponseMetaData `json:"meta"` Data *json.RawMessage `json:"data"` }
type ResponseFirewallRules ¶
type ResponseFirewallRules struct { Meta ResponseMetaData `json:"meta"` Data []FirewallRule `json:"data"` }
type ResponseMetaData ¶
type ResponseMetaData struct {
Rc string `json:"rc"`
}
Click to show internal directories.
Click to hide internal directories.