Documentation ¶
Index ¶
- Variables
- func CheckResponse(r *http.Response) error
- type APIKeyTransport
- type AddOpts
- type AlertsDeleteOpts
- type AlertsListOpts
- type AlertsService
- func (s *AlertsService) Add(ctx context.Context, alerts models.AddAlertsRequest) (*models.AddAlertsResponse, *Response, error)
- func (s *AlertsService) Delete(ctx context.Context, opts AlertsDeleteOpts) (*models.DeleteAlertsResponse, *Response, error)
- func (s *AlertsService) DeleteOne(ctx context.Context, alert_id string) (*models.DeleteAlertsResponse, *Response, error)
- func (s *AlertsService) GetByID(ctx context.Context, alertID int) (*models.Alert, *Response, error)
- func (s *AlertsService) List(ctx context.Context, opts AlertsListOpts) (*models.GetAlertsResponse, *Response, error)
- type ApiClient
- type AuthService
- func (s *AuthService) AuthenticateWatcher(ctx context.Context, auth models.WatcherAuthRequest) (models.WatcherAuthResponse, *Response, error)
- func (s *AuthService) EnrollWatcher(ctx context.Context, enrollKey string, name string, tags []string, ...) (*Response, error)
- func (s *AuthService) RegisterWatcher(ctx context.Context, registration models.WatcherRegistrationRequest) (*Response, error)
- func (s *AuthService) UnregisterWatcher(ctx context.Context) (*Response, error)
- type Config
- type DecisionDeleteService
- type DecisionsDeleteOpts
- type DecisionsListOpts
- type DecisionsService
- func (s *DecisionsService) Delete(ctx context.Context, opts DecisionsDeleteOpts) (*models.DeleteDecisionResponse, *Response, error)
- func (s *DecisionsService) DeleteOne(ctx context.Context, decision_id string) (*models.DeleteDecisionResponse, *Response, error)
- func (s *DecisionsService) FetchV2Decisions(ctx context.Context, url string) (*models.DecisionsStreamResponse, *Response, error)
- func (s *DecisionsService) FetchV3Decisions(ctx context.Context, url string) (*models.DecisionsStreamResponse, *Response, error)
- func (s *DecisionsService) GetDecisionsFromBlocklist(ctx context.Context, blocklist *modelscapi.BlocklistLink, ...) ([]*models.Decision, bool, error)
- func (s *DecisionsService) GetDecisionsFromGroups(decisionsGroups []*modelscapi.GetDecisionsStreamResponseNewItem) []*models.Decision
- func (s *DecisionsService) GetStream(ctx context.Context, opts DecisionsStreamOpts) (*models.DecisionsStreamResponse, *Response, error)
- func (s *DecisionsService) GetStreamV3(ctx context.Context, opts DecisionsStreamOpts) (*modelscapi.GetDecisionsStreamResponse, *Response, error)
- func (s *DecisionsService) List(ctx context.Context, opts DecisionsListOpts) (*models.GetDecisionsResponse, *Response, error)
- func (s *DecisionsService) StopStream(ctx context.Context) (*Response, error)
- func (s *DecisionsService) StreamDecisions(ctx context.Context, opts DecisionsStreamOpts) (*Response, error)
- type DecisionsStreamOpts
- type DeleteOpts
- type ErrorResponse
- type HeartBeatService
- type JWTTransport
- type ListOpts
- type MetricsService
- type Response
- type SignalService
Constants ¶
This section is empty.
Variables ¶
View Source
var ( InsecureSkipVerify = false Cert *tls.Certificate CaCertPool *x509.CertPool )
Functions ¶
func CheckResponse ¶
Types ¶
type APIKeyTransport ¶
type APIKeyTransport struct { APIKey string // Transport is the underlying HTTP transport to use when making requests. // It will default to http.DefaultTransport if nil. Transport http.RoundTripper URL *url.URL VersionPrefix string UserAgent string }
func (*APIKeyTransport) Client ¶
func (t *APIKeyTransport) Client() *http.Client
type AlertsDeleteOpts ¶
type AlertsDeleteOpts struct { ScopeEquals *string `url:"scope,omitempty"` ValueEquals *string `url:"value,omitempty"` ScenarioEquals *string `url:"scenario,omitempty"` IPEquals *string `url:"ip,omitempty"` RangeEquals *string `url:"range,omitempty"` Since *string `url:"since,omitempty"` Until *string `url:"until,omitempty"` OriginEquals *string `url:"origin,omitempty"` ActiveDecisionEquals *bool `url:"has_active_decision,omitempty"` SourceEquals *string `url:"alert_source,omitempty"` Contains *bool `url:"contains,omitempty"` Limit *int `url:"limit,omitempty"` ListOpts }
type AlertsListOpts ¶
type AlertsListOpts struct { ScopeEquals *string `url:"scope,omitempty"` ValueEquals *string `url:"value,omitempty"` ScenarioEquals *string `url:"scenario,omitempty"` IPEquals *string `url:"ip,omitempty"` RangeEquals *string `url:"range,omitempty"` OriginEquals *string `url:"origin,omitempty"` Since *string `url:"since,omitempty"` TypeEquals *string `url:"decision_type,omitempty"` Until *string `url:"until,omitempty"` IncludeSimulated *bool `url:"simulated,omitempty"` ActiveDecisionEquals *bool `url:"has_active_decision,omitempty"` IncludeCAPI *bool `url:"include_capi,omitempty"` Limit *int `url:"limit,omitempty"` Contains *bool `url:"contains,omitempty"` ListOpts }
type AlertsService ¶
type AlertsService service
func (*AlertsService) Add ¶
func (s *AlertsService) Add(ctx context.Context, alerts models.AddAlertsRequest) (*models.AddAlertsResponse, *Response, error)
func (*AlertsService) Delete ¶
func (s *AlertsService) Delete(ctx context.Context, opts AlertsDeleteOpts) (*models.DeleteAlertsResponse, *Response, error)
to demo query arguments
func (*AlertsService) DeleteOne ¶
func (s *AlertsService) DeleteOne(ctx context.Context, alert_id string) (*models.DeleteAlertsResponse, *Response, error)
func (*AlertsService) List ¶
func (s *AlertsService) List(ctx context.Context, opts AlertsListOpts) (*models.GetAlertsResponse, *Response, error)
to demo query arguments
type ApiClient ¶
type ApiClient struct { /*config stuff*/ BaseURL *url.URL PapiURL *url.URL URLPrefix string UserAgent string /*exposed Services*/ Decisions *DecisionsService DecisionDelete *DecisionDeleteService Alerts *AlertsService Auth *AuthService Metrics *MetricsService Signal *SignalService HeartBeat *HeartBeatService // contains filtered or unexported fields }
func NewDefaultClient ¶
type AuthService ¶
type AuthService service
func (*AuthService) AuthenticateWatcher ¶
func (s *AuthService) AuthenticateWatcher(ctx context.Context, auth models.WatcherAuthRequest) (models.WatcherAuthResponse, *Response, error)
func (*AuthService) EnrollWatcher ¶
func (*AuthService) RegisterWatcher ¶
func (s *AuthService) RegisterWatcher(ctx context.Context, registration models.WatcherRegistrationRequest) (*Response, error)
func (*AuthService) UnregisterWatcher ¶
func (s *AuthService) UnregisterWatcher(ctx context.Context) (*Response, error)
type DecisionDeleteService ¶
type DecisionDeleteService service
func (*DecisionDeleteService) Add ¶
func (d *DecisionDeleteService) Add(ctx context.Context, deletedDecisions *models.DecisionsDeleteRequest) (interface{}, *Response, error)
DecisionDeleteService purposely reuses AddSignalsRequestItemDecisions model
type DecisionsDeleteOpts ¶
type DecisionsDeleteOpts struct { ScopeEquals *string `url:"scope,omitempty"` ValueEquals *string `url:"value,omitempty"` TypeEquals *string `url:"type,omitempty"` IPEquals *string `url:"ip,omitempty"` RangeEquals *string `url:"range,omitempty"` Contains *bool `url:"contains,omitempty"` OriginEquals *string `url:"origin,omitempty"` // ScenarioEquals *string `url:"scenario,omitempty"` ListOpts }
type DecisionsListOpts ¶
type DecisionsService ¶
type DecisionsService service
func (*DecisionsService) Delete ¶
func (s *DecisionsService) Delete(ctx context.Context, opts DecisionsDeleteOpts) (*models.DeleteDecisionResponse, *Response, error)
func (*DecisionsService) DeleteOne ¶
func (s *DecisionsService) DeleteOne(ctx context.Context, decision_id string) (*models.DeleteDecisionResponse, *Response, error)
func (*DecisionsService) FetchV2Decisions ¶
func (s *DecisionsService) FetchV2Decisions(ctx context.Context, url string) (*models.DecisionsStreamResponse, *Response, error)
func (*DecisionsService) FetchV3Decisions ¶
func (s *DecisionsService) FetchV3Decisions(ctx context.Context, url string) (*models.DecisionsStreamResponse, *Response, error)
func (*DecisionsService) GetDecisionsFromBlocklist ¶
func (s *DecisionsService) GetDecisionsFromBlocklist(ctx context.Context, blocklist *modelscapi.BlocklistLink, lastPullTimestamp *string) ([]*models.Decision, bool, error)
func (*DecisionsService) GetDecisionsFromGroups ¶
func (s *DecisionsService) GetDecisionsFromGroups(decisionsGroups []*modelscapi.GetDecisionsStreamResponseNewItem) []*models.Decision
func (*DecisionsService) GetStream ¶
func (s *DecisionsService) GetStream(ctx context.Context, opts DecisionsStreamOpts) (*models.DecisionsStreamResponse, *Response, error)
func (*DecisionsService) GetStreamV3 ¶
func (s *DecisionsService) GetStreamV3(ctx context.Context, opts DecisionsStreamOpts) (*modelscapi.GetDecisionsStreamResponse, *Response, error)
func (*DecisionsService) List ¶
func (s *DecisionsService) List(ctx context.Context, opts DecisionsListOpts) (*models.GetDecisionsResponse, *Response, error)
to demo query arguments
func (*DecisionsService) StopStream ¶
func (s *DecisionsService) StopStream(ctx context.Context) (*Response, error)
func (*DecisionsService) StreamDecisions ¶
func (s *DecisionsService) StreamDecisions(ctx context.Context, opts DecisionsStreamOpts) (*Response, error)
type DecisionsStreamOpts ¶
type DeleteOpts ¶
type DeleteOpts struct { }
type ErrorResponse ¶
type ErrorResponse struct {
models.ErrorResponse
}
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
type HeartBeatService ¶
type HeartBeatService service
func (*HeartBeatService) StartHeartBeat ¶
func (h *HeartBeatService) StartHeartBeat(ctx context.Context, t *tomb.Tomb)
type JWTTransport ¶
type JWTTransport struct { MachineID *string Password *strfmt.Password Token string Expiration time.Time Scenarios []string URL *url.URL VersionPrefix string UserAgent string // Transport is the underlying HTTP transport to use when making requests. // It will default to http.DefaultTransport if nil. Transport http.RoundTripper UpdateScenario func() ([]string, error) // contains filtered or unexported fields }
func (*JWTTransport) Client ¶
func (t *JWTTransport) Client() *http.Client
func (*JWTTransport) ResetToken ¶
func (t *JWTTransport) ResetToken()
type MetricsService ¶
type MetricsService service
type SignalService ¶
type SignalService service
func (*SignalService) Add ¶
func (s *SignalService) Add(ctx context.Context, signals *models.AddSignalsRequest) (interface{}, *Response, error)
Click to show internal directories.
Click to hide internal directories.