Documentation
¶
Index ¶
- Constants
- func BlueprintDocumentInfoToInclude(blueprintDocInfo *BlueprintDocumentInfo) (*subengine.ResolvedInclude, error)
- func BlueprintLocationString(payload *BlueprintDocumentInfo) string
- func ResolveBlueprintForRequest(r *http.Request, w http.ResponseWriter, documentInfo *BlueprintDocumentInfo, ...) (*includes.ChildBlueprintInfo, bool)
- type BlueprintDocumentInfo
- type InvalidLocationMetadataError
Constants ¶
const ( // S3SourceType is the `sourceType` field for resolving // blueprints from AWS S3. S3SourceType = "aws/s3" // AzureBlobStorageSourceType is the `sourceType` field for resolving // blueprints from Azure Blob Storage. AzureBlobStorageSourceType = "azure/blob" // GoogleCloudStorageSourceType is the `sourceType` field for resolving // blueprints from Google Cloud Storage. GoogleCloudStorageSourceType = "googlecloud/storage" // HTTPSSourceType is the `sourceType` field for resolving // blueprints from a public HTTPS URL. HTTPSSourceType = "https" )
Variables ¶
This section is empty.
Functions ¶
func BlueprintDocumentInfoToInclude ¶
func BlueprintDocumentInfoToInclude( blueprintDocInfo *BlueprintDocumentInfo, ) (*subengine.ResolvedInclude, error)
BlueprintDocumentInfoToInclude generates an include from the given blueprint document info derived from a request payload.
func BlueprintLocationString ¶
func BlueprintLocationString( payload *BlueprintDocumentInfo, ) string
BlueprintLocationString returns a string representation of the blueprint location based on the provided BlueprintDocumentInfo that represents blueprint location information derived from a request payload.
func ResolveBlueprintForRequest ¶
func ResolveBlueprintForRequest( r *http.Request, w http.ResponseWriter, documentInfo *BlueprintDocumentInfo, resolver includes.ChildResolver, logger core.Logger, ) (*includes.ChildBlueprintInfo, bool)
ResolveBlueprintForRequest resolves a blueprint for a HTTP request. This will return the result containing resolved blueprint info and a boolean, that if true, indicates that an error occurred and a response has been sent to the client.
Types ¶
type BlueprintDocumentInfo ¶
type BlueprintDocumentInfo struct {
// FileSourceScheme is the file source scheme
// to determine where the blueprint document is located.
// This can one of the following:
//
// `file`: The blueprint document is located on the local file system of the Deploy Engine server.
// `s3`: The blueprint document is located in an S3 bucket.
// `gcs`: The blueprint document is located in a Google Cloud Storage bucket.
// `azureblob`: The blueprint document is located in an Azure Blob Storage container.
// `https`: The blueprint document is located via a public HTTPS URL.
//
// For remote source authentication, the Deploy Engine server will need to be configured
// with the appropriate credentials to access the remote source.
// Authentication is not supported `https` sources.
//
// If not provided, the default value of `file` will be used.
FileSourceScheme string `json:"fileSourceScheme" validate:"oneof=file s3 gcs azureblob https"`
// Directory where the blueprint document is located.
// For `file` sources, this must be an absolute path to the directory
// on the local file system of the Deploy Engine server.
// An example for a `file` source would be `/path/to/blueprint-directory`.
// For `s3`, `gcs` and `azureblob` sources, this must be the path to the
// virtual directory where the first path segment is the bucket/container name
// and the rest of the path is the path to the virtual directory.
//
// An example for a remote object storage source would be
/// `bucket-name/path/to/blueprint-directory`.
// For `https` sources, this must be the base URL to the blueprint document
// excluding the scheme.
// An example for a `https` source would be `example.com/path/to/blueprint-directory`.
Directory string `json:"directory" validate:"required"`
// BlueprintFile is the name of the blueprint file to validate.
//
// If not provided, the default value of `project.blueprint.yml` will be used.
BlueprintFile string `json:"blueprintFile"`
// BlueprintLocationMetadata is a mapping of string keys to
// scalar values that hold additional information about the location
// of the blueprint document.
// For example, this can be used to specify the region of the bucket/container
// where the blueprint document is located in a cloud storage service.
BlueprintLocationMetadata map[string]any `json:"blueprintLocationMetadata"`
}
BlueprintDocumentInfo is a type that provides information about the location of a source blueprint document. This is mostly used to be able to use the blueprint resolvers package to load blueprint documents from multiple sources without them needing to be child blueprints.
type InvalidLocationMetadataError ¶
type InvalidLocationMetadataError struct {
Reason string
}
InvalidLocationMetadataError is an error that indicates that the location metadata provided in a request payload that involves resolving a blueprint document is invalid.
Example to check for this error type:
var targetErr *resolve.InvalidLocationMetadataError
if errors.As(err, &targetErr) {
// Handle the error
}
func (*InvalidLocationMetadataError) Error ¶
func (e *InvalidLocationMetadataError) Error() string