Documentation
¶
Index ¶
Constants ¶
View Source
const (
ErrFormatString = "%w: %s"
)
Variables ¶
View Source
var ( ErrFailedToCreateRequest = errors.New("failed to create request") ErrFailedToMarshalPayload = errors.New("failed to marshal payload") ErrFailedToCreateAuthRequest = errors.New("failed to create authenticated request") ErrFailedToMakeRequest = errors.New("failed to make request") ErrFailedToUploadStacks = errors.New("failed to upload stacks") ErrFailedToMarshalRequestBody = errors.New("failed to marshal request body") ErrFailedToReadResponseBody = errors.New("error reading response body") ErrFailedToUnmarshalJSON = errors.New("error unmarshaling JSON") ErrFailedToLockStack = errors.New("an error occurred while attempting to lock stack") ErrFailedToUnlockStack = errors.New("an error occurred while attempting to unlock stack") ErrOIDCWorkspaceIDRequired = errors.New("workspace ID environment variable is required for OIDC authentication") ErrOIDCTokenExchangeFailed = errors.New("failed to exchange OIDC token for Atmos token") ErrOIDCAuthFailedNoToken = errors.New("OIDC authentication failed and API token is not set") ErrNotInGitHubActions = errors.New("not running in GitHub Actions or missing OIDC token environment variables") ErrFailedToGetOIDCToken = errors.New("failed to get OIDC token") ErrFailedToDecodeOIDCResponse = errors.New("failed to decode OIDC token response") ErrFailedToExchangeOIDCToken = errors.New("failed to exchange OIDC token") ErrFailedToDecodeTokenResponse = errors.New("failed to decode token response") )
Functions ¶
This section is empty.
Types ¶
type AtmosApiResponse ¶
type AtmosProAPIClient ¶
type AtmosProAPIClient struct {
APIToken string
BaseAPIEndpoint string
BaseURL string
HTTPClient *http.Client
Logger *logger.Logger
}
AtmosProAPIClient represents the client to interact with the AtmosPro API.
func NewAtmosProAPIClient ¶
func NewAtmosProAPIClient(logger *logger.Logger, baseURL, baseAPIEndpoint, apiToken string) *AtmosProAPIClient
NewAtmosProAPIClient creates a new instance of AtmosProAPIClient
func NewAtmosProAPIClientFromEnv ¶
func NewAtmosProAPIClientFromEnv(logger *logger.Logger) (*AtmosProAPIClient, error)
NewAtmosProAPIClientFromEnv creates a new AtmosProAPIClient from environment variables
func (*AtmosProAPIClient) LockStack ¶
func (c *AtmosProAPIClient) LockStack(dto LockStackRequest) (LockStackResponse, error)
LockStack locks a specific stack
func (*AtmosProAPIClient) UnlockStack ¶
func (c *AtmosProAPIClient) UnlockStack(dto UnlockStackRequest) (UnlockStackResponse, error)
UnlockStack unlocks a specific stack
func (*AtmosProAPIClient) UploadAffectedStacks ¶
func (c *AtmosProAPIClient) UploadAffectedStacks(dto AffectedStacksUploadRequest) error
UploadAffectedStacks uploads information about affected stacks
type GitHubOIDCAuthRequest ¶
type GitHubOIDCAuthRequest struct {
Token string `json:"token"`
WorkspaceID string `json:"workspaceId"`
}
GitHubOIDCAuthRequest represents the request to exchange OIDC token for Atmos token.
type GitHubOIDCAuthResponse ¶
type GitHubOIDCAuthResponse struct {
Token string `json:"token"`
}
GitHubOIDCAuthResponse represents the response from Atmos Pro's OIDC auth endpoint.
type GitHubOIDCResponse ¶
type GitHubOIDCResponse struct {
Value string `json:"value"`
}
GitHubOIDCResponse represents the response from GitHub's OIDC token endpoint.
type LockStackRequest ¶
type LockStackResponse ¶
type LockStackResponse struct {
AtmosApiResponse
Data struct {
ID string `json:"id,omitempty"`
WorkspaceId string `json:"workspaceId,omitempty"`
Key string `json:"key,omitempty"`
LockMessage string `json:"lockMessage,omitempty"`
ExpiresAt time.Time `json:"expiresAt,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
DeletedAt time.Time `json:"deletedAt,omitempty"`
} `json:"data"`
}
type Property ¶
type Property struct {
ID string `json:"id,omitempty"`
LockID string `json:"lockId,omitempty"`
Key string `json:"key,omitempty"`
Value string `json:"value,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
DeletedAt time.Time `json:"deletedAt,omitempty"`
}
type UnlockStackRequest ¶
type UnlockStackRequest struct {
Key string `json:"key"`
}
type UnlockStackResponse ¶
type UnlockStackResponse struct {
AtmosApiResponse
Data struct{} `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.