Documentation ¶
Overview ¶
Manages credential-type artifacts
Index ¶
- Constants
- func NewClient(endpoint string, apiKey string) graphql.Client
- func NewMutationError(msg string, validationErrors []MutationValidationError) error
- type Artifact
- type ArtifactDefinition
- type ArtifactDefinitionWithSchema
- type ContainerRepository
- type ContainerRepositoryInput
- type Credential
- type Deployment
- type Environment
- type Manifest
- type MutationError
- type MutationValidationError
- type Package
- type PreviewConfig
- type PreviewEnvironmentInput
- func (v *PreviewEnvironmentInput) GetCiContext() map[string]interface{}
- func (v *PreviewEnvironmentInput) GetCredentials() []Credential
- func (v *PreviewEnvironmentInput) GetPackageConfigurations() map[string]interface{}
- func (v *PreviewEnvironmentInput) MarshalJSON() ([]byte, error)
- func (v *PreviewEnvironmentInput) UnmarshalJSON(b []byte) error
- type PreviewPackage
- type Project
- type RemoteRef
- type Secret
- type Target
Constants ¶
const Endpoint string = "https://api.massdriver.cloud/api/"
Variables ¶
This section is empty.
Functions ¶
func NewMutationError ¶
func NewMutationError(msg string, validationErrors []MutationValidationError) error
Types ¶
type Artifact ¶
func CreateArtifact ¶
type ArtifactDefinition ¶
type ArtifactDefinition struct {
Name string
}
func ListCredentialTypes ¶
func ListCredentialTypes() []*ArtifactDefinition
List supported credential types
type ArtifactDefinitionWithSchema ¶
func GetArtifactDefinitions ¶
func GetArtifactDefinitions(client graphql.Client, orgID string) ([]ArtifactDefinitionWithSchema, error)
type ContainerRepository ¶
func GetContainerRepository ¶
func GetContainerRepository(client graphql.Client, artifactID, orgID, imageName, location string) (*ContainerRepository, error)
type ContainerRepositoryInput ¶
type ContainerRepositoryInput struct { Location string `json:"location"` ImageName string `json:"imageName"` }
Arguments required to get container repositories
func (*ContainerRepositoryInput) GetImageName ¶
func (v *ContainerRepositoryInput) GetImageName() string
GetImageName returns ContainerRepositoryInput.ImageName, and is useful for accessing the field via an interface.
func (*ContainerRepositoryInput) GetLocation ¶
func (v *ContainerRepositoryInput) GetLocation() string
GetLocation returns ContainerRepositoryInput.Location, and is useful for accessing the field via an interface.
type Credential ¶
type Credential struct { ArtifactDefinitionType string `json:"artifactDefinitionType"` ArtifactId string `json:"artifactId"` }
func (*Credential) GetArtifactDefinitionType ¶
func (v *Credential) GetArtifactDefinitionType() string
GetArtifactDefinitionType returns Credential.ArtifactDefinitionType, and is useful for accessing the field via an interface.
func (*Credential) GetArtifactId ¶
func (v *Credential) GetArtifactId() string
GetArtifactId returns Credential.ArtifactId, and is useful for accessing the field via an interface.
type Deployment ¶
func DeployPackage ¶
func DeployPackage(client graphql.Client, orgID, targetID, manifestID, message string) (*Deployment, error)
func GetDeployment ¶
type Environment ¶
func DeployPreviewEnvironment ¶
func DeployPreviewEnvironment(client graphql.Client, orgID string, projectID string, credentials []Credential, packageParams map[string]interface{}, ciContext map[string]interface{}) (*Environment, error)
type MutationError ¶
type MutationError struct { Err string Messages []MutationValidationError }
func (*MutationError) Error ¶
func (m *MutationError) Error() string
type MutationValidationError ¶
type MutationValidationError struct { // A friendly error message, appropriate for display to the end user. // // The message is interpolated to include the appropriate variables. // // Example: `Username must be at least 10 characters` // // This message may change without notice, so we do not recommend you match against the text. // Instead, use the *code* field for matching. Message string `json:"message"` }
MutationValidationError includes the requested fields of the GraphQL type ValidationMessage. The GraphQL type's documentation follows.
Validation messages are returned when mutation input does not meet the requirements. While client-side validation is highly recommended to provide the best User Experience, All inputs will always be validated server-side.
Some examples of validations are:
* Username must be at least 10 characters * Email field does not contain an email address * Birth Date is required
While GraphQL has support for required values, mutation data fields are always set to optional in our API. This allows 'required field' messages to be returned in the same manner as other validations. The only exceptions are id fields, which may be required to perform updates or deletes.
func (*MutationValidationError) GetMessage ¶
func (v *MutationValidationError) GetMessage() string
GetMessage returns MutationValidationError.Message, and is useful for accessing the field via an interface.
type Package ¶
type Package struct { ID string NamePrefix string Params map[string]interface{} Manifest Manifest Target Target }
func ConfigurePackage ¶
type PreviewConfig ¶
type PreviewConfig struct { ProjectSlug string `json:"projectSlug"` Credentials []Credential `json:"credentials"` Packages map[string]PreviewPackage `json:"packages"` }
func (*PreviewConfig) GetCredentials ¶
func (p *PreviewConfig) GetCredentials() []Credential
type PreviewEnvironmentInput ¶
type PreviewEnvironmentInput struct { Credentials []Credential `json:"credentials"` PackageConfigurations map[string]interface{} `json:"-"` // CI Context CiContext map[string]interface{} `json:"-"` }
func (*PreviewEnvironmentInput) GetCiContext ¶
func (v *PreviewEnvironmentInput) GetCiContext() map[string]interface{}
GetCiContext returns PreviewEnvironmentInput.CiContext, and is useful for accessing the field via an interface.
func (*PreviewEnvironmentInput) GetCredentials ¶
func (v *PreviewEnvironmentInput) GetCredentials() []Credential
GetCredentials returns PreviewEnvironmentInput.Credentials, and is useful for accessing the field via an interface.
func (*PreviewEnvironmentInput) GetPackageConfigurations ¶
func (v *PreviewEnvironmentInput) GetPackageConfigurations() map[string]interface{}
GetPackageConfigurations returns PreviewEnvironmentInput.PackageConfigurations, and is useful for accessing the field via an interface.
func (*PreviewEnvironmentInput) MarshalJSON ¶
func (v *PreviewEnvironmentInput) MarshalJSON() ([]byte, error)
func (*PreviewEnvironmentInput) UnmarshalJSON ¶
func (v *PreviewEnvironmentInput) UnmarshalJSON(b []byte) error
type PreviewPackage ¶
type Project ¶
func GetProject ¶
func (*Project) GetDefaultParams ¶
func (p *Project) GetDefaultParams() map[string]PreviewPackage