Documentation
¶
Index ¶
- Constants
- Variables
- func AuthMethodFromMetadata(meta any) string
- func CredentialsFromIntegration(ctx core.IntegrationContext, scopes ...string) (*google.Credentials, error)
- func FindSecretValue(secrets []core.IntegrationSecret, name string) []byte
- func IsAlreadyExistsError(err error) bool
- func IsNotFoundError(err error) bool
- func ParseGCPError(statusCode int, body []byte) error
- func TokenSourceFromIntegration(ctx core.IntegrationContext, scopes ...string) (oauth2.TokenSource, error)
- type Client
- func (c *Client) BaseURL() string
- func (c *Client) ExecRequest(ctx context.Context, method, url string, body io.Reader) ([]byte, error)
- func (c *Client) Get(ctx context.Context, path string) ([]byte, error)
- func (c *Client) GetURL(ctx context.Context, fullURL string) ([]byte, error)
- func (c *Client) Post(ctx context.Context, path string, body any) ([]byte, error)
- func (c *Client) PostURL(ctx context.Context, fullURL string, body any) ([]byte, error)
- func (c *Client) ProjectID() string
- type GCPAPIError
- type Metadata
Constants ¶
View Source
const ( SecretNameServiceAccountKey = "serviceAccountKey" SecretNameAccessToken = "accessToken" ScopeCloudPlatform = "https://www.googleapis.com/auth/cloud-platform" ActionNameEnsureCloudBuild = "ensureCloudBuild" ActionNameEnsureArtifactRegistry = "ensureArtifactRegistry" ActionNameEnsurePubSubOnMessage = "ensurePubSubOnMessage" )
View Source
const ( AuthMethodServiceAccountKey = "serviceAccountKey" AuthMethodWIF = "workloadIdentityFederation" )
Variables ¶
View Source
var RequiredJSONKeys = []string{"type", "project_id", "private_key_id", "private_key", "client_email", "client_id"}
Functions ¶
func AuthMethodFromMetadata ¶
func CredentialsFromIntegration ¶
func CredentialsFromIntegration(ctx core.IntegrationContext, scopes ...string) (*google.Credentials, error)
func FindSecretValue ¶
func FindSecretValue(secrets []core.IntegrationSecret, name string) []byte
func IsAlreadyExistsError ¶
func IsNotFoundError ¶
func ParseGCPError ¶
func TokenSourceFromIntegration ¶
func TokenSourceFromIntegration(ctx core.IntegrationContext, scopes ...string) (oauth2.TokenSource, error)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(httpClient core.HTTPContext, integration core.IntegrationContext) (*Client, error)
func (*Client) ExecRequest ¶
type GCPAPIError ¶
func (*GCPAPIError) Error ¶
func (e *GCPAPIError) Error() string
type Metadata ¶
type Metadata struct {
ProjectID string `json:"projectId"`
ClientEmail string `json:"clientEmail"`
AuthMethod string `json:"authMethod"`
AccessTokenExpiresAt string `json:"accessTokenExpiresAt"`
PubSubTopic string `json:"pubsubTopic,omitempty"`
PubSubSubscription string `json:"pubsubSubscription,omitempty"`
CloudBuildSubscription string `json:"cloudBuildSubscription,omitempty"`
ArtifactPushSubscription string `json:"artifactPushSubscription,omitempty"`
ContainerAnalysisSubscription string `json:"containerAnalysisSubscription,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.