Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client acts likes a manager of the jobs.
func New ¶
func New(cfg *config.Config, pdAPIKey, slackAPIKey string, logger *zap.Logger, opts ...ClientOption) *Client
New creates a Client for Slack & PagerDuty API.
func (*Client) GetMembers ¶
GetMembers get all members that should be a member of the usergroup(s) For can specify Slack user and Pagerduty users, teams, services and also schedules.
type ClientOption ¶
type ClientOption func(*options)
ClientOption are options that developers can configure for the Slackduty clients
func WithExternalTrigger ¶
func WithExternalTrigger() ClientOption
WithExternalTrigger should be used when this process is kicked by external resources(e.g. Cloud Scheduler, Unix crontab).
type PagerdutyClient ¶
type PagerdutyClient interface {
GetScheduledUser(string) ([]pagerduty.User, error)
GetService(string) ([]pagerduty.User, error)
GetTeam(string) ([]pagerduty.User, error)
GetUser(string) (*pagerduty.User, error)
}
PagerdutyClient is a interface that the PagerDuty client should implement
func NewPagerDutyClient ¶
func NewPagerDutyClient(apiKey string) PagerdutyClient
NewPagerDutyClient creates a new PagerDuty API client
type SlackClient ¶
type SlackClient interface {
CreateUsergroup() error
GetUser(string) (*slack.User, error)
GetUsergroups() ([]slack.UserGroup, error)
UpdateUsergroup(string, string) error
}
SlackClient is a interface that the Slack client should implement
func NewSlackClient ¶
func NewSlackClient(apiKey string) SlackClient
NewSlackClient creates a new Slack API client