v2

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2023 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateAlertPath = "%s/api/alerts"
	DeleteAlertPath = "%s/api/alerts/%d"
	UpdateAlertPath = "%s/api/alerts/%d"
	GetAlertPath    = "%s/api/alerts/%d"
)
View Source
const (
	GetMePath                 = "/api/users/me"
	AuthorizationHeader       = "Authorization"
	ContentTypeHeader         = "Content-Type"
	ContentTypeJSON           = "application/json"
	ContentTypeFormURLEncoded = "x-www-form-urlencoded"
)
View Source
const (
	CreateGroupMappingPath = "%s/api/groupmappings"
	UpdateGroupMappingPath = "%s/api/groupmappings/%d"
	DeleteGroupMappingPath = "%s/api/groupmappings/%d"
	GetGroupMappingPath    = "%s/api/groupmappings/%d"
)
View Source
const (
	IBMInstanceIDHeader   = "IBMInstanceID"
	IBMIAMPath            = "/identity/token"
	IBMGrantTypeFormValue = "grant_type"
	IBMApiKeyFormValue    = "apikey"
	IBMAPIKeyGrantType    = "urn:ibm:params:oauth:grant-type:apikey"
	SysdigTeamIDHeader    = "SysdigTeamID"
	GetTeamByNamePath     = "/api/v2/teams/light/name/"
)
View Source
const (
	CreateListPath = "%s/api/secure/falco/lists"
	GetListPath    = "%s/api/secure/falco/lists/%d"
	UpdateListPath = "%s/api/secure/falco/lists/%d"
	DeleteListPath = "%s/api/secure/falco/lists/%d"
)
View Source
const (
	CreateMacroPath  = "%s/api/secure/falco/macros"
	GetMacroByIDPath = "%s/api/secure/falco/macros/%d"
	UpdateMacroPath  = "%s/api/secure/falco/macros/%d"
	DeleteMacroPath  = "%s/api/secure/falco/macros/%d"
)
View Source
const (
	GetNotificationChannels = "%s/api/notificationChannels"
	GetNotificationChannel  = "%s/api/notificationChannels/%d"
)
View Source
const (
	CreatePolicyPath = "%s/api/v2/policies"
	DeletePolicyPath = "%s/api/v2/policies/%d"
	UpdatePolicyPath = "%s/api/v2/policies/%d"
	GetPolicyPath    = "%s/api/v2/policies/%d"
)
View Source
const (
	GetUsersLightPath = "%s/api/users/light"
	GetTeamsPath      = "%s/api/teams"
	GetTeamPath       = "%s/api/teams/%d"
)
View Source
const (
	GetUserByUsernamePath = "%s/api/users/%s"
	GetUserPath           = "%s/api/users/%d"
	GetUsersPath          = "%s/api/users"
	CreateUserPath        = "%s/api/user/provisioning/"
	UpdateUserPath        = "%s/api/users/%d"
	DeleteUserPath        = "%s/api/users/%d"
	GetCurrentUserPath    = "%s/api/users/me"
)

Variables

View Source
var GroupMappingNotFound = errors.New("group mapping not found")

Functions

func Marshal

func Marshal[T any](data T) (io.Reader, error)

func Unmarshal

func Unmarshal[T any](data io.ReadCloser) (T, error)

Types

type Action added in v1.4.1

type Action struct {
	AfterEventNs         int    `json:"afterEventNs,omitempty"`
	BeforeEventNs        int    `json:"beforeEventNs,omitempty"`
	Name                 string `json:"name,omitempty"`
	IsLimitedToContainer bool   `json:"isLimitedToContainer"`
	Type                 string `json:"type"`
}

type Alert added in v1.4.0

type Alert struct {
	ID                     int                 `json:"id,omitempty"`
	Version                int                 `json:"version,omitempty"`
	Type                   string              `json:"type"`
	Name                   string              `json:"name"`
	Description            string              `json:"description"`
	Enabled                bool                `json:"enabled"`
	GroupName              string              `json:"groupName,omitempty"`
	NotificationChannelIds []int               `json:"notificationChannelIds"`
	Filter                 string              `json:"filter"`
	Severity               int                 `json:"severity"`
	Timespan               int                 `json:"timespan"`
	CustomNotification     *CustomNotification `json:"customNotification"`
	TeamID                 int                 `json:"teamId,omitempty"`
	AutoCreated            bool                `json:"autoCreated"`
	SysdigCapture          *SysdigCapture      `json:"sysdigCapture"`
	RateOfChange           bool                `json:"rateOfChange,omitempty"`
	ReNotifyMinutes        int                 `json:"reNotifyMinutes"`
	ReNotify               bool                `json:"reNotify"`
	Valid                  bool                `json:"valid"`
	SeverityLabel          string              `json:"severityLabel,omitempty"`
	SegmentBy              []string            `json:"segmentBy"`
	SegmentCondition       *SegmentCondition   `json:"segmentCondition"`
	Criteria               *Criteria           `json:"criteria,omitempty"`
	Monitor                []*Monitor          `json:"monitor,omitempty"`
	Condition              string              `json:"condition"`
	SeverityLevel          int                 `json:"severityLevel,omitempty"`
}

type AlertInterface added in v1.4.0

type AlertInterface interface {
	Base
	CreateAlert(ctx context.Context, alert Alert) (Alert, error)
	DeleteAlert(ctx context.Context, alertID int) error
	UpdateAlert(ctx context.Context, alert Alert) (Alert, error)
	GetAlertByID(ctx context.Context, alertID int) (Alert, error)
}

type Base added in v1.3.0

type Base interface {
	CurrentTeamID(ctx context.Context) (int, error)
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (*Client) CreateAlert added in v1.4.0

func (client *Client) CreateAlert(ctx context.Context, alert Alert) (Alert, error)

func (*Client) CreateAlertURL added in v1.4.0

func (client *Client) CreateAlertURL() string

func (*Client) CreateGroupMapping added in v1.4.0

func (client *Client) CreateGroupMapping(ctx context.Context, gm *GroupMapping) (*GroupMapping, error)

func (*Client) CreateGroupMappingURL added in v1.4.0

func (client *Client) CreateGroupMappingURL() string

func (*Client) CreateList added in v1.4.1

func (client *Client) CreateList(ctx context.Context, list List) (List, error)

func (*Client) CreateListURL added in v1.4.1

func (client *Client) CreateListURL() string

func (*Client) CreateMacro added in v1.4.1

func (client *Client) CreateMacro(ctx context.Context, macro Macro) (Macro, error)

func (*Client) CreateMacroURL added in v1.4.1

func (client *Client) CreateMacroURL() string

func (*Client) CreateNotificationChannel added in v1.2.0

func (client *Client) CreateNotificationChannel(ctx context.Context, channel NotificationChannel) (NotificationChannel, error)

func (*Client) CreatePolicy added in v1.4.1

func (client *Client) CreatePolicy(ctx context.Context, policy Policy) (Policy, error)

func (*Client) CreatePolicyURL added in v1.4.1

func (client *Client) CreatePolicyURL() string

func (*Client) CreateTeam

func (client *Client) CreateTeam(ctx context.Context, team Team) (Team, error)

func (*Client) CreateUser added in v1.4.0

func (client *Client) CreateUser(ctx context.Context, user *User) (*User, error)

func (*Client) CreateUsersURL added in v1.4.0

func (client *Client) CreateUsersURL() string

func (*Client) CurrentTeamID added in v1.3.0

func (client *Client) CurrentTeamID(ctx context.Context) (int, error)

func (*Client) DeleteAlert added in v1.4.0

func (client *Client) DeleteAlert(ctx context.Context, alertID int) error

func (*Client) DeleteAlertURL added in v1.4.0

func (client *Client) DeleteAlertURL(alertID int) string

func (*Client) DeleteGroupMapping added in v1.4.0

func (client *Client) DeleteGroupMapping(ctx context.Context, id int) error

func (*Client) DeleteGroupMappingURL added in v1.4.0

func (client *Client) DeleteGroupMappingURL(id int) string

func (*Client) DeleteList added in v1.4.1

func (client *Client) DeleteList(ctx context.Context, id int) error

func (*Client) DeleteListURL added in v1.4.1

func (client *Client) DeleteListURL(id int) string

func (*Client) DeleteMacro added in v1.4.1

func (client *Client) DeleteMacro(ctx context.Context, id int) error

func (*Client) DeleteMacroURL added in v1.4.1

func (client *Client) DeleteMacroURL(id int) string

func (*Client) DeleteNotificationChannel added in v1.2.0

func (client *Client) DeleteNotificationChannel(ctx context.Context, id int) error

func (*Client) DeletePolicy added in v1.4.1

func (client *Client) DeletePolicy(ctx context.Context, policyID int) error

func (*Client) DeletePolicyURL added in v1.4.1

func (client *Client) DeletePolicyURL(policyID int) string

func (*Client) DeleteTeam

func (client *Client) DeleteTeam(ctx context.Context, id int) error

func (*Client) DeleteUser added in v1.4.0

func (client *Client) DeleteUser(ctx context.Context, id int) error

func (*Client) DeleteUserURL added in v1.4.0

func (client *Client) DeleteUserURL(id int) string

func (*Client) ErrorFromResponse

func (client *Client) ErrorFromResponse(response *http.Response) error

func (*Client) GetAlertByID added in v1.4.0

func (client *Client) GetAlertByID(ctx context.Context, alertID int) (Alert, error)

func (*Client) GetAlertByIDURL added in v1.4.0

func (client *Client) GetAlertByIDURL(alertID int) string

func (*Client) GetCurrentUser added in v1.4.0

func (client *Client) GetCurrentUser(ctx context.Context) (u *User, err error)

func (*Client) GetCurrentUserURL added in v1.4.0

func (client *Client) GetCurrentUserURL() string

func (*Client) GetGroupMapping added in v1.4.0

func (client *Client) GetGroupMapping(ctx context.Context, id int) (*GroupMapping, error)

func (*Client) GetGroupMappingURL added in v1.4.0

func (client *Client) GetGroupMappingURL(id int) string

func (*Client) GetListByID added in v1.4.1

func (client *Client) GetListByID(ctx context.Context, id int) (List, error)

func (*Client) GetListURL added in v1.4.1

func (client *Client) GetListURL(id int) string

func (*Client) GetMacroByID added in v1.4.1

func (client *Client) GetMacroByID(ctx context.Context, id int) (Macro, error)

func (*Client) GetMacroByIDURL added in v1.4.1

func (client *Client) GetMacroByIDURL(id int) string

func (*Client) GetNotificationChannelById added in v1.2.0

func (client *Client) GetNotificationChannelById(ctx context.Context, id int) (NotificationChannel, error)

func (*Client) GetNotificationChannelByName added in v1.2.0

func (client *Client) GetNotificationChannelByName(ctx context.Context, name string) (NotificationChannel, error)

func (*Client) GetNotificationChannelUrl added in v1.2.0

func (client *Client) GetNotificationChannelUrl(id int) string

func (*Client) GetNotificationChannelsUrl added in v1.2.0

func (client *Client) GetNotificationChannelsUrl() string

func (*Client) GetPolicyByID added in v1.4.1

func (client *Client) GetPolicyByID(ctx context.Context, policyID int) (Policy, int, error)

func (*Client) GetPolicyURL added in v1.4.1

func (client *Client) GetPolicyURL(policyID int) string

func (*Client) GetTeamById

func (client *Client) GetTeamById(ctx context.Context, id int) (Team, error)

func (*Client) GetTeamURL

func (client *Client) GetTeamURL(id int) string

func (*Client) GetTeamsURL

func (client *Client) GetTeamsURL() string

func (*Client) GetUserByEmail added in v1.4.0

func (client *Client) GetUserByEmail(ctx context.Context, email string) (*User, error)

func (*Client) GetUserById added in v1.4.0

func (client *Client) GetUserById(ctx context.Context, id int) (*User, error)

func (*Client) GetUserByUsername added in v1.4.0

func (client *Client) GetUserByUsername(ctx context.Context, username string) (*User, error)

func (*Client) GetUserByUsernameURL added in v1.4.0

func (client *Client) GetUserByUsernameURL(username string) string

func (*Client) GetUserIDByEmail

func (client *Client) GetUserIDByEmail(ctx context.Context, userRoles []UserRoles) ([]UserRoles, error)

func (*Client) GetUserUrl added in v1.4.0

func (client *Client) GetUserUrl(id int) string

func (*Client) GetUsersLightURL

func (client *Client) GetUsersLightURL() string

func (*Client) GetUsersUrl added in v1.4.0

func (client *Client) GetUsersUrl() string

func (*Client) UpdateAlert added in v1.4.0

func (client *Client) UpdateAlert(ctx context.Context, alert Alert) (Alert, error)

func (*Client) UpdateAlertURL added in v1.4.0

func (client *Client) UpdateAlertURL(alertID int) string

func (*Client) UpdateGroupMapping added in v1.4.0

func (client *Client) UpdateGroupMapping(ctx context.Context, gm *GroupMapping, id int) (*GroupMapping, error)

func (*Client) UpdateGroupMappingURL added in v1.4.0

func (client *Client) UpdateGroupMappingURL(id int) string

func (*Client) UpdateList added in v1.4.1

func (client *Client) UpdateList(ctx context.Context, list List) (List, error)

func (*Client) UpdateListURL added in v1.4.1

func (client *Client) UpdateListURL(id int) string

func (*Client) UpdateMacro added in v1.4.1

func (client *Client) UpdateMacro(ctx context.Context, macro Macro) (Macro, error)

func (*Client) UpdateMacroURL added in v1.4.1

func (client *Client) UpdateMacroURL(id int) string

func (*Client) UpdateNotificationChannel added in v1.2.0

func (client *Client) UpdateNotificationChannel(ctx context.Context, channel NotificationChannel) (NotificationChannel, error)

func (*Client) UpdatePolicy added in v1.4.1

func (client *Client) UpdatePolicy(ctx context.Context, policy Policy) (Policy, error)

func (*Client) UpdatePolicyURL added in v1.4.1

func (client *Client) UpdatePolicyURL(policyID int) string

func (*Client) UpdateTeam

func (client *Client) UpdateTeam(ctx context.Context, team Team) (Team, error)

func (*Client) UpdateUser added in v1.4.0

func (client *Client) UpdateUser(ctx context.Context, user *User) (*User, error)

func (*Client) UpdateUserURL added in v1.4.0

func (client *Client) UpdateUserURL(id int) string

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 WithSysdigTeamID added in v1.3.0

func WithSysdigTeamID(teamID *int) ClientOption

func WithSysdigTeamName added in v1.3.0

func WithSysdigTeamName(teamName string) ClientOption

func WithToken

func WithToken(token string) ClientOption

func WithURL

func WithURL(url string) ClientOption

type Criteria added in v1.4.0

type Criteria struct {
	Text   string `json:"text"`
	Source string `json:"source"`
}

type CustomNotification added in v1.4.0

type CustomNotification struct {
	TitleTemplate  string `json:"titleTemplate"`
	UseNewTemplate bool   `json:"useNewTemplate"`
	PrependText    string `json:"prependText,omitempty"`
	AppendText     string `json:"appendText,omitempty"`
}

type EntryPoint

type EntryPoint struct {
	Module    string `json:"module"`
	Selection string `json:"selection,omitempty"`
}

type GroupMapping added in v1.4.0

type GroupMapping struct {
	ID         int      `json:"id,omitempty"`
	GroupName  string   `json:"groupName,omitempty"`
	Role       string   `json:"role,omitempty"`
	SystemRole string   `json:"systemRole,omitempty"`
	TeamMap    *TeamMap `json:"teamMap,omitempty"`
}

type GroupMappingInterface added in v1.4.0

type GroupMappingInterface interface {
	Base
	CreateGroupMapping(ctx context.Context, gm *GroupMapping) (*GroupMapping, error)
	UpdateGroupMapping(ctx context.Context, gm *GroupMapping, id int) (*GroupMapping, error)
	DeleteGroupMapping(ctx context.Context, id int) error
	GetGroupMapping(ctx context.Context, id int) (*GroupMapping, error)
}

type IAMTokenResponse added in v1.1.0

type IAMTokenResponse struct {
	AccessToken string `json:"access_token"`
	Expiration  int64  `json:"expiration"`
}

type IBMAccessToken added in v1.1.0

type IBMAccessToken string

type IBMCommon added in v1.1.0

type IBMCommon interface {
	Common
}

type IBMMonitor added in v1.1.0

type IBMMonitor interface {
	IBMCommon
	MonitorCommon
}

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
}

func (*IBMRequest) CurrentTeamID added in v1.3.0

func (ir *IBMRequest) CurrentTeamID(ctx context.Context) (int, error)

func (*IBMRequest) Request added in v1.1.0

func (ir *IBMRequest) Request(ctx context.Context, method string, url string, payload io.Reader) (*http.Response, error)

type Items added in v1.4.1

type Items struct {
	Items []string `json:"items"`
}

type List added in v1.4.1

type List struct {
	Name    string `json:"name"`
	Items   Items  `json:"items"`
	Append  bool   `json:"append"`
	ID      int    `json:"id,omitempty"`
	Version int    `json:"version,omitempty"`
}

type ListInterface added in v1.4.1

type ListInterface interface {
	CreateList(ctx context.Context, list List) (List, error)
	GetListByID(ctx context.Context, id int) (List, error)
	UpdateList(ctx context.Context, list List) (List, error)
	DeleteList(ctx context.Context, id int) error
}

type Macro added in v1.4.1

type Macro struct {
	ID        int            `json:"id,omitempty"`
	Version   int            `json:"version,omitempty"`
	Name      string         `json:"name"`
	Condition MacroCondition `json:"condition"`
	Append    bool           `json:"append"`
}

type MacroCondition added in v1.4.1

type MacroCondition struct {
	Condition string `json:"condition"`
}

type MacroInterface added in v1.4.1

type MacroInterface interface {
	CreateMacro(ctx context.Context, macro Macro) (Macro, error)
	GetMacroByID(ctx context.Context, id int) (Macro, error)
	UpdateMacro(ctx context.Context, macro Macro) (Macro, error)
	DeleteMacro(ctx context.Context, id int) error
}

type Monitor

type Monitor struct {
	Metric       string  `json:"metric"`
	StdDevFactor float64 `json:"stdDevFactor"`
}

type MonitorCommon added in v1.4.0

type MonitorCommon interface {
	AlertInterface
}

type NamespaceFilters added in v1.1.0

type NamespaceFilters struct {
	IBMPlatformMetrics *string `json:"ibmPlatformMetrics"`
}

type NotificationChannel added in v1.2.0

type NotificationChannel struct {
	ID      int                        `json:"id,omitempty"`
	Version int                        `json:"version,omitempty"`
	Type    string                     `json:"type"`
	Name    string                     `json:"name"`
	Enabled bool                       `json:"enabled"`
	TeamID  *int                       `json:"teamId,omitempty"`
	Options NotificationChannelOptions `json:"options"`
}

type NotificationChannelInterface added in v1.2.0

type NotificationChannelInterface interface {
	Base
	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 Policy added in v1.4.1

type Policy struct {
	ID                     int      `json:"id,omitempty"`
	Name                   string   `json:"name"`
	Description            string   `json:"description"`
	Severity               int      `json:"severity"`
	Enabled                bool     `json:"enabled"`
	RuleNames              []string `json:"ruleNames"`
	Actions                []Action `json:"actions"`
	Scope                  string   `json:"scope,omitempty"`
	Version                int      `json:"version,omitempty"`
	NotificationChannelIds []int    `json:"notificationChannelIds"`
	Type                   string   `json:"type"`
	Runbook                string   `json:"runbook"`
}

type PolicyInterface added in v1.4.1

type PolicyInterface interface {
	CreatePolicy(ctx context.Context, policy Policy) (Policy, error)
	DeletePolicy(ctx context.Context, policyID int) error
	UpdatePolicy(ctx context.Context, policy Policy) (Policy, error)
	GetPolicyByID(ctx context.Context, policyID int) (Policy, int, error)
}

type Requester added in v0.7.3

type Requester interface {
	CurrentTeamID(ctx context.Context) (int, error)
	Request(ctx context.Context, method string, url string, payload io.Reader) (*http.Response, error)
}

type SegmentCondition added in v1.4.0

type SegmentCondition struct {
	Type string `json:"type"`
}

type SysdigCapture added in v1.4.0

type SysdigCapture struct {
	Name       string      `json:"name"`
	Filters    string      `json:"filters,omitempty"`
	Duration   int         `json:"duration"`
	Type       string      `json:"type,omitempty"`
	BucketName string      `json:"bucketName"`
	Folder     string      `json:"folder,omitempty"`
	Enabled    bool        `json:"enabled"`
	StorageID  interface{} `json:"storageId,omitempty"`
}

type SysdigCommon added in v1.1.0

type SysdigCommon interface {
	Common
	GroupMappingInterface
}

type SysdigMonitor added in v1.1.0

type SysdigMonitor interface {
	SysdigCommon
	MonitorCommon
}

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
}

func (*SysdigRequest) CurrentTeamID added in v1.3.0

func (sr *SysdigRequest) CurrentTeamID(ctx context.Context) (int, error)

func (*SysdigRequest) Request added in v0.7.3

func (sr *SysdigRequest) Request(ctx context.Context, method string, url string, payload io.Reader) (*http.Response, error)

type SysdigSecure added in v1.1.0

type SysdigSecure interface {
	SysdigCommon
	PolicyInterface
	ListInterface
	MacroInterface
}

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 {
	Base
	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 TeamMap added in v1.4.0

type TeamMap struct {
	AllTeams bool  `json:"allTeams"`
	TeamIDs  []int `json:"teamIds"`
}

type UnixTimestamp added in v1.1.0

type UnixTimestamp int64

type User added in v1.3.0

type User struct {
	ID          int    `json:"id,omitempty"`
	Version     int    `json:"version,omitempty"`
	SystemRole  string `json:"systemRole,omitempty"`
	Email       string `json:"username"`
	FirstName   string `json:"firstName,omitempty"`
	LastName    string `json:"lastName,omitempty"`
	CurrentTeam *int   `json:"currentTeam"`
}

type UserInterface added in v1.4.0

type UserInterface interface {
	GetUserById(ctx context.Context, id int) (*User, error)
	GetUserByUsername(ctx context.Context, username string) (*User, error)
	GetUserByEmail(ctx context.Context, email string) (*User, error)
	CreateUser(ctx context.Context, user *User) (*User, error)
	UpdateUser(ctx context.Context, user *User) (*User, error)
	DeleteUser(ctx context.Context, id int) error
	GetCurrentUser(ctx context.Context) (u *User, err error)
}

type UserRoles

type UserRoles struct {
	UserId int    `json:"userId"`
	Email  string `json:"userName,omitempty"`
	Role   string `json:"role"`
	Admin  bool   `json:"admin,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL