Documentation
¶
Index ¶
- Constants
- func Marshal[T any](data T) (io.Reader, error)
- func Unmarshal[T any](data io.ReadCloser) (T, error)
- type Client
- func (client *Client) CreateNotificationChannel(ctx context.Context, channel NotificationChannel) (NotificationChannel, error)
- func (client *Client) CreateTeam(ctx context.Context, team Team) (Team, error)
- func (client *Client) DeleteNotificationChannel(ctx context.Context, id int) error
- func (client *Client) DeleteTeam(ctx context.Context, id int) error
- func (client *Client) ErrorFromResponse(response *http.Response) error
- func (client *Client) GetNotificationChannelById(ctx context.Context, id int) (NotificationChannel, error)
- func (client *Client) GetNotificationChannelByName(ctx context.Context, name string) (NotificationChannel, error)
- func (client *Client) GetNotificationChannelUrl(id int) string
- func (client *Client) GetNotificationChannelsUrl() string
- func (client *Client) GetTeamById(ctx context.Context, id int) (Team, error)
- func (client *Client) GetTeamURL(id int) string
- func (client *Client) GetTeamsURL() string
- func (client *Client) GetUserIDByEmail(ctx context.Context, userRoles []UserRoles) ([]UserRoles, error)
- func (client *Client) GetUsersLightURL() string
- func (client *Client) UpdateNotificationChannel(ctx context.Context, channel NotificationChannel) (NotificationChannel, error)
- func (client *Client) UpdateTeam(ctx context.Context, team Team) (Team, error)
- type ClientOption
- func WithExtraHeaders(headers map[string]string) ClientOption
- func WithIBMAPIKey(key string) ClientOption
- func WithIBMIamURL(url string) ClientOption
- func WithIBMInstanceID(instanceID string) ClientOption
- func WithInsecure(insecure bool) ClientOption
- func WithToken(token string) ClientOption
- func WithURL(url string) ClientOption
- type Common
- type EntryPoint
- type IAMTokenResponse
- type IBMAccessToken
- type IBMCommon
- type IBMMonitor
- type IBMRequest
- type NamespaceFilters
- type NotificationChannel
- type NotificationChannelInterface
- type NotificationChannelOptions
- type Requester
- type SysdigCommon
- type SysdigMonitor
- type SysdigRequest
- type SysdigSecure
- type Team
- type TeamInterface
- type UnixTimestamp
- type UserRoles
- type UsersList
Constants ¶
View Source
const ( AuthorizationHeader = "Authorization" ContentTypeHeader = "Content-Type" ContentTypeJSON = "application/json" ContentTypeFormURLEncoded = "x-www-form-urlencoded" )
View Source
const ( IBMInstanceIDHeader = "IBMInstanceID" IBMIAMPath = "/identity/token" IBMGrantTypeFormValue = "grant_type" IBMApiKeyFormValue = "apikey" IBMAPIKeyGrantType = "urn:ibm:params:oauth:grant-type:apikey" )
View Source
const ( GetNotificationChannels = "%s/api/notificationChannels" GetNotificationChannel = "%s/api/notificationChannels/%d" )
View Source
const ( GetUsersPath = "%s/api/users/light" GetTeamsPath = "%s/api/teams" GetTeamPath = "%s/api/teams/%d" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateNotificationChannel ¶ added in v1.2.0
func (client *Client) CreateNotificationChannel(ctx context.Context, channel NotificationChannel) (NotificationChannel, error)
func (*Client) CreateTeam ¶
func (*Client) DeleteNotificationChannel ¶ added in v1.2.0
func (*Client) ErrorFromResponse ¶
func (*Client) GetNotificationChannelById ¶ added in v1.2.0
func (*Client) GetNotificationChannelByName ¶ added in v1.2.0
func (*Client) GetNotificationChannelUrl ¶ added in v1.2.0
func (*Client) GetNotificationChannelsUrl ¶ added in v1.2.0
func (*Client) GetTeamById ¶
func (*Client) GetTeamURL ¶
func (*Client) GetTeamsURL ¶
func (*Client) GetUserIDByEmail ¶
func (*Client) GetUsersLightURL ¶
func (*Client) UpdateNotificationChannel ¶ added in v1.2.0
func (client *Client) UpdateNotificationChannel(ctx context.Context, channel NotificationChannel) (NotificationChannel, error)
type ClientOption ¶
type ClientOption func(c *config)
func WithExtraHeaders ¶
func WithExtraHeaders(headers map[string]string) ClientOption
func WithIBMAPIKey ¶ added in v1.1.0
func WithIBMAPIKey(key string) ClientOption
func WithIBMIamURL ¶ added in v1.1.0
func WithIBMIamURL(url string) ClientOption
func WithIBMInstanceID ¶ added in v1.1.0
func WithIBMInstanceID(instanceID string) ClientOption
func WithInsecure ¶
func WithInsecure(insecure bool) ClientOption
func WithToken ¶
func WithToken(token string) ClientOption
func WithURL ¶
func WithURL(url string) ClientOption
type Common ¶
type Common interface {
TeamInterface
NotificationChannelInterface
}
type EntryPoint ¶
type IAMTokenResponse ¶ added in v1.1.0
type IBMAccessToken ¶ added in v1.1.0
type IBMAccessToken string
type IBMMonitor ¶ added in v1.1.0
type IBMMonitor interface {
IBMCommon
}
func NewIBMMonitor ¶ added in v1.1.0
func NewIBMMonitor(opts ...ClientOption) IBMMonitor
type IBMRequest ¶ added in v1.1.0
type IBMRequest struct {
// contains filtered or unexported fields
}
type NamespaceFilters ¶ added in v1.1.0
type NamespaceFilters struct {
IBMPlatformMetrics *string `json:"ibmPlatformMetrics"`
}
type NotificationChannel ¶ added in v1.2.0
type NotificationChannelInterface ¶ added in v1.2.0
type NotificationChannelInterface interface {
GetNotificationChannelById(ctx context.Context, id int) (NotificationChannel, error)
GetNotificationChannelByName(ctx context.Context, name string) (NotificationChannel, error)
CreateNotificationChannel(ctx context.Context, channel NotificationChannel) (NotificationChannel, error)
UpdateNotificationChannel(ctx context.Context, channel NotificationChannel) (NotificationChannel, error)
DeleteNotificationChannel(ctx context.Context, id int) error
}
type NotificationChannelOptions ¶ added in v1.2.0
type NotificationChannelOptions struct {
EmailRecipients []string `json:"emailRecipients,omitempty"` // Type: email
SnsTopicARNs []string `json:"snsTopicARNs,omitempty"` // Type: SNS
APIKey string `json:"apiKey,omitempty"` // Type: VictorOps
RoutingKey string `json:"routingKey,omitempty"` // Type: VictorOps
Url string `json:"url,omitempty"` // Type: OpsGenie, Webhook and Slack
Channel string `json:"channel,omitempty"` // Type: Slack
Account string `json:"account,omitempty"` // Type: PagerDuty
ServiceKey string `json:"serviceKey,omitempty"` // Type: PagerDuty
ServiceName string `json:"serviceName,omitempty"` // Type: PagerDuty
AdditionalHeaders map[string]interface{} `json:"additionalHeaders,omitempty"` // Type: Webhook
Region string `json:"region,omitempty"` // Type: OpsGenie
NotifyOnOk bool `json:"notifyOnOk"`
NotifyOnResolve bool `json:"notifyOnResolve"`
SendTestNotification bool `json:"sendTestNotification"`
}
type SysdigCommon ¶ added in v1.1.0
type SysdigCommon interface {
Common
}
type SysdigMonitor ¶ added in v1.1.0
type SysdigMonitor interface {
SysdigCommon
}
func NewSysdigMonitor ¶ added in v1.1.0
func NewSysdigMonitor(opts ...ClientOption) SysdigMonitor
type SysdigRequest ¶ added in v0.7.3
type SysdigRequest struct {
// contains filtered or unexported fields
}
type SysdigSecure ¶ added in v1.1.0
type SysdigSecure interface {
SysdigCommon
}
func NewSysdigSecure ¶ added in v1.1.0
func NewSysdigSecure(opts ...ClientOption) SysdigSecure
type Team ¶
type Team struct {
UserRoles []UserRoles `json:"userRoles,omitempty"`
Description string `json:"description"`
Name string `json:"name"`
ID int `json:"id,omitempty"`
Version int `json:"version,omitempty"`
Origin string `json:"origin,omitempty"`
LastUpdated int64 `json:"lastUpdated,omitempty"`
EntryPoint *EntryPoint `json:"entryPoint,omitempty"`
Theme string `json:"theme"`
CustomerID int `json:"customerId,omitempty"`
DateCreated int64 `json:"dateCreated,omitempty"`
Products []string `json:"products,omitempty"`
Show string `json:"show,omitempty"`
Immutable bool `json:"immutable,omitempty"`
CanUseSysdigCapture *bool `json:"canUseSysdigCapture,omitempty"`
CanUseCustomEvents *bool `json:"canUseCustomEvents,omitempty"`
CanUseAwsMetrics *bool `json:"canUseAwsMetrics,omitempty"`
CanUseBeaconMetrics *bool `json:"canUseBeaconMetrics,omitempty"`
UserCount int `json:"userCount,omitempty"`
Filter string `json:"filter,omitempty"`
NamespaceFilters *NamespaceFilters `json:"namespaceFilters,omitempty"`
DefaultTeam bool `json:"default,omitempty"`
}
type TeamInterface ¶
type TeamInterface interface {
GetUserIDByEmail(ctx context.Context, userRoles []UserRoles) ([]UserRoles, error)
GetTeamById(ctx context.Context, id int) (t Team, err error)
CreateTeam(ctx context.Context, tRequest Team) (t Team, err error)
UpdateTeam(ctx context.Context, tRequest Team) (t Team, err error)
DeleteTeam(ctx context.Context, id int) error
}
type UnixTimestamp ¶ added in v1.1.0
type UnixTimestamp int64
Click to show internal directories.
Click to hide internal directories.