Documentation
¶
Index ¶
- Constants
- type BasicAttribute
- type Client
- func (c *Client) GetScheduleOwnerIDs(ctx context.Context, scheduleID string) (*int, []string, error)
- func (c *Client) GetSchedules(ctx context.Context, pToken string) ([]Schedule, string, error)
- func (c *Client) GetSecrets(ctx context.Context, pToken string) ([]Secret, string, error)
- func (c *Client) GetTeamMemberAndAdminIDs(ctx context.Context, teamID string) ([]int, []int, error)
- func (c *Client) GetTeams(ctx context.Context, pToken string) ([]Team, string, error)
- func (c *Client) GetUsers(ctx context.Context, pToken string) ([]User, string, error)
- func (c *Client) IsTest() bool
- func (c *Client) ListAllScheduleRotationUsers(ctx context.Context, rotationID string) ([]int, error)
- func (c *Client) ListOnCallUsers(ctx context.Context, scheduleID string) ([]int, error)
- func (c *Client) ListScheduleRotationUsers(ctx context.Context, rotationID string, pToken string) ([]int, string, error)
- func (c *Client) ListScheduleRotations(ctx context.Context, scheduleID string, pToken string) ([]string, string, error)
- type Links
- type Meta
- type ObjectWithoutAttributes
- type RootlyError
- type RootlyErrorResponse
- type Schedule
- type ScheduleAttributes
- type ScheduleResponse
- type ScheduleRotationUser
- type ScheduleRotationUserAttributes
- type ScheduleRotationUsersResponse
- type ScheduleRotationsResponse
- type ScheduleShiftsResponse
- type SchedulesResponse
- type Secret
- type SecretAttributes
- type SecretsResponse
- type Team
- type TeamAttributes
- type TeamResponse
- type TeamsResponse
- type User
- type UserAttributes
- type UsersResponse
Constants ¶
const ( BaseURLStr = "https://api.rootly.com" ListUsersAPIEndpoint = "/v1/users" ListTeamsAPIEndpoint = "/v1/teams" GetTeamAPIEndpoint = "/v1/teams/%s" ListSecretsAPIEndpoint = "/v1/secrets" ListSchedulesAPIEndpoint = "/v1/schedules" GetScheduleAPIEndpoint = "/v1/schedules/%s" ListScheduleRotationsAPIEndpoint = "/v1/schedules/%s/schedule_rotations" ListScheduleRotationUsersAPIEndpoint = "/v1/schedule_rotations/%s/schedule_rotation_users" ListScheduleShiftsAPIEndpoint = "/v1/shifts" ResourcesPageSize = 200 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicAttribute ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(ctx context.Context, baseURL string, apiKey string, resourcesPageSize int) (*Client, error)
NewClient creates a new Rootly client. Allows for a configurable base URL, API key, and resources page size.
func (*Client) GetScheduleOwnerIDs ¶ added in v0.0.2
func (c *Client) GetScheduleOwnerIDs( ctx context.Context, scheduleID string, ) (*int, []string, error)
GetScheduleOwnerIDs returns an owner user ID and a list of owner team IDs for a given schedule ID.
func (*Client) GetSchedules ¶ added in v0.0.2
GetSchedules fetches the schedules from the Rootly API. It supports pagination using a page token.
func (*Client) GetSecrets ¶ added in v0.0.2
GetSecrets fetches the secrets from the Rootly API. It supports pagination using a page token.
func (*Client) GetTeamMemberAndAdminIDs ¶
func (c *Client) GetTeamMemberAndAdminIDs( ctx context.Context, teamID string, ) ([]int, []int, error)
GetTeamMemberAndAdminIDs returns a list of member user IDs and admin user IDs for a given team ID.
func (*Client) GetTeams ¶
GetTeams fetches the teams from the Rootly API. It supports pagination using a page token.
func (*Client) GetUsers ¶
GetUsers fetches users from the Rootly API. It supports pagination using a page token.
func (*Client) ListAllScheduleRotationUsers ¶ added in v0.0.2
func (c *Client) ListAllScheduleRotationUsers( ctx context.Context, rotationID string, ) ([]int, error)
ListAllScheduleRotationUsers returns a list of all the member user IDs for a given schedule rotation ID. It uses pagination under the hood to make one or more requests to build the full list.
func (*Client) ListOnCallUsers ¶ added in v0.0.2
ListOnCallUsers returns a list of on-call user IDs for a given schedule ID.
func (*Client) ListScheduleRotationUsers ¶ added in v0.0.2
func (c *Client) ListScheduleRotationUsers( ctx context.Context, rotationID string, pToken string, ) ([]int, string, error)
ListScheduleRotationUsers returns a list of user IDs for a given schedule rotation ID. It supports pagination using a page token.
func (*Client) ListScheduleRotations ¶ added in v0.0.2
func (c *Client) ListScheduleRotations( ctx context.Context, scheduleID string, pToken string, ) ([]string, string, error)
ListScheduleRotations returns a list of schedule rotation IDs for a given schedule ID. It supports pagination using a page token.
type ObjectWithoutAttributes ¶ added in v0.0.2
type RootlyError ¶ added in v0.0.7
type RootlyErrorResponse ¶ added in v0.0.7
type RootlyErrorResponse struct {
Errors []RootlyError `json:"errors"`
}
RootlyError represents an error response from the Rootly API.
func (*RootlyErrorResponse) Message ¶ added in v0.0.7
func (e *RootlyErrorResponse) Message() string
Message implements the uhttp.ErrorResponse interface.
type Schedule ¶ added in v0.0.2
type Schedule struct {
ID string `json:"id"`
Type string `json:"type"`
Attributes ScheduleAttributes `json:"attributes"`
}
type ScheduleAttributes ¶ added in v0.0.2
type ScheduleResponse ¶ added in v0.0.2
type ScheduleResponse struct {
Data Schedule `json:"data"`
}
type ScheduleRotationUser ¶ added in v0.0.2
type ScheduleRotationUser struct {
ID string `json:"id"`
Type string `json:"type"`
Attributes ScheduleRotationUserAttributes `json:"attributes"`
}
type ScheduleRotationUserAttributes ¶ added in v0.0.2
type ScheduleRotationUserAttributes struct {
UserID int `json:"user_id"`
}
type ScheduleRotationUsersResponse ¶ added in v0.0.2
type ScheduleRotationUsersResponse struct {
Data []ScheduleRotationUser `json:"data"`
Links Links `json:"links"`
Meta Meta `json:"meta"`
}
type ScheduleRotationsResponse ¶ added in v0.0.2
type ScheduleRotationsResponse struct {
Data []ObjectWithoutAttributes `json:"data"`
Links Links `json:"links"`
Meta Meta `json:"meta"`
}
type ScheduleShiftsResponse ¶ added in v0.0.2
type ScheduleShiftsResponse struct {
// note there's a data object available but don't need it
Included []ObjectWithoutAttributes `json:"included"`
}
type SchedulesResponse ¶ added in v0.0.2
type Secret ¶ added in v0.0.2
type Secret struct {
ID string `json:"id"`
Type string `json:"type"`
Attributes SecretAttributes `json:"attributes"`
}
type SecretAttributes ¶ added in v0.0.2
type SecretsResponse ¶ added in v0.0.2
type Team ¶
type Team struct {
ID string `json:"id"`
Type string `json:"type"`
Attributes TeamAttributes `json:"attributes"`
}
type TeamAttributes ¶
type TeamResponse ¶
type TeamResponse struct {
Data Team `json:"data"`
}
type TeamsResponse ¶
type User ¶
type User struct {
ID string `json:"id"`
Type string `json:"type"`
Attributes UserAttributes `json:"attributes"`
}