Documentation ¶
Index ¶
- Constants
- func BicepTemplate(manifest *Manifest, options AppHostOptions) (*memfs.FS, error)
- func ContainerAppManifestTemplateForProject(manifest *Manifest, projectName string, options AppHostOptions) (string, error)
- func Containers(manifest *Manifest) map[string]genContainer
- func Dockerfiles(manifest *Manifest) map[string]genDockerfile
- func EvalString(src string, evalExpr func(string) (string, error)) (string, error)
- func GenerateProjectArtifacts(ctx context.Context, projectDir string, projectName string, manifest *Manifest, ...) (map[string]ContentsAndMode, error)
- func IsAspireDashboardEnabled(alphaFeatureManager *alpha.FeatureManager) bool
- func ProjectPaths(manifest *Manifest) map[string]string
- type AppHostOptions
- type AspireDashboard
- type Binding
- type ContentsAndMode
- type DaprComponentResourceMetadata
- type DaprResourceMetadata
- type Input
- type InputDefault
- type InputDefaultGenerate
- type Manifest
- type Reference
- type Resource
- type Volume
Constants ¶
const DaprPubSubComponentType = "pubsub"
const DaprStateStoreComponentType = "state"
const RedisContainerAppService = "redis"
Variables ¶
This section is empty.
Functions ¶
func BicepTemplate ¶
func BicepTemplate(manifest *Manifest, options AppHostOptions) (*memfs.FS, error)
BicepTemplate returns a filesystem containing the generated bicep files for the given manifest. These files represent the shared infrastructure that would normally be under the `infra/` folder for the given manifest.
func ContainerAppManifestTemplateForProject ¶
func ContainerAppManifestTemplateForProject( manifest *Manifest, projectName string, options AppHostOptions) (string, error)
ContainerAppManifestTemplateForProject returns the container app manifest template for a given project. It can be used (after evaluation) to deploy the service to a container app environment.
func Containers ¶
Containers returns information about all container.v0 resources from a manifest.
func Dockerfiles ¶
Dockerfiles returns information about all dockerfile.v0 resources from a manifest.
func EvalString ¶
evalString evaluates a given string expression, using the provided evalExpr function to produce values for expressions in the string. It supports strings that contain expressions of the form "{expression}" where "expression" is any string that does not contain a '}' character. The evalExpr function is called with the expression (without the enclosing '{' and '}' characters) and should return the value to be substituted into the string. If the evalExpr function returns an error, evalString will return that error. The '{' and '}' characters can be escaped by doubling them, e.g. "{{" and "}}". If a string is malformed (e.g. an unmatched '{' or '}' character), evalString will return an error.
func GenerateProjectArtifacts ¶
func GenerateProjectArtifacts( ctx context.Context, projectDir string, projectName string, manifest *Manifest, appHostProject string, ) (map[string]ContentsAndMode, error)
GenerateProjectArtifacts generates all the artifacts to manage a project with `azd`. The azure.yaml file as well as a helpful next-steps.md file.
func IsAspireDashboardEnabled ¶
func IsAspireDashboardEnabled(alphaFeatureManager *alpha.FeatureManager) bool
func ProjectPaths ¶
ProjectPaths returns a map of project names to their paths.
Types ¶
type AppHostOptions ¶
type AspireDashboard ¶
type AspireDashboard struct {
Link string
}
func AspireDashboardUrl ¶
func AspireDashboardUrl( ctx context.Context, env *environment.Environment, alphaFeatureManager *alpha.FeatureManager) *AspireDashboard
func (*AspireDashboard) MarshalJSON ¶
func (aspireD *AspireDashboard) MarshalJSON() ([]byte, error)
func (*AspireDashboard) ToString ¶
func (aspireD *AspireDashboard) ToString(currentIndentation string) string
type ContentsAndMode ¶
type DaprComponentResourceMetadata ¶
type DaprComponentResourceMetadata struct {
Type *string `json:"type"`
}
type DaprResourceMetadata ¶
type DaprResourceMetadata struct { AppId *string `json:"appId,omitempty"` Application *string `json:"application,omitempty"` AppPort *int `json:"appPort,omitempty"` AppProtocol *string `json:"appProtocol,omitempty"` DaprHttpMaxRequestSize *int `json:"daprHttpMaxRequestSize,omitempty"` DaprHttpReadBufferSize *int `json:"daprHttpReadBufferSize,omitempty"` EnableApiLogging *bool `json:"enableApiLogging,omitempty"` LogLevel *string `json:"logLevel,omitempty"` }
type Input ¶
type Input struct { Type string `json:"type"` Secret bool `json:"secret"` Default *InputDefault `json:"default,omitempty"` }
type InputDefault ¶
type InputDefault struct {
Generate *InputDefaultGenerate `json:"generate,omitempty"`
}
type InputDefaultGenerate ¶
type InputDefaultGenerate struct { MinLength *uint `json:"minLength,omitempty"` Lower *bool `json:"lower,omitempty"` Upper *bool `json:"upper,omitempty"` Numeric *bool `json:"numeric,omitempty"` Special *bool `json:"special,omitempty"` MinLower *uint `json:"minLower,omitempty"` MinUpper *uint `json:"minUpper,omitempty"` MinNumeric *uint `json:"minNumeric,omitempty"` MinSpecial *uint `json:"minSpecial,omitempty"` }
type Manifest ¶
type Resource ¶
type Resource struct { // Type is present on all resource types Type string `json:"type"` // Path is present on a project.v0 resource and is the path to the project file, and on a dockerfile.v0 // resource and is the path to the Dockerfile (including the "Dockerfile" filename). // For a bicep.v0 resource, it is the path to the bicep file. Path *string `json:"path,omitempty"` // Context is present on a dockerfile.v0 resource and is the path to the context directory. Context *string `json:"context,omitempty"` // BuildArgs is present on a dockerfile.v0 resource and is the --build-arg for building the docker image. BuildArgs map[string]string `json:"buildArgs,omitempty"` // Args is optionally present on project.v0 and dockerfile.v0 resources and are the arguments to pass to the container. Args []string `json:"args,omitempty"` // Parent is present on a resource which is a child of another. It is the name of the parent resource. For example, a // postgres.database.v0 is a child of a postgres.server.v0, and so it would have a parent of which is the name of // the server resource. Parent *string `json:"parent,omitempty"` // Image is present on a container.v0 resource and is the image to use for the container. Image *string `json:"image,omitempty"` // Bindings is present on container.v0, project.v0 and dockerfile.v0 resources, and is a map of binding names to // binding details. Bindings custommaps.WithOrder[Binding] `json:"bindings,omitempty"` // Env is present on project.v0, container.v0 and dockerfile.v0 resources, and is a map of environment variable // names to value expressions. The value expressions are simple expressions like "{redis.connectionString}" or // "{postgres.port}" to allow referencing properties of other resources. The set of properties supported in these // expressions depends on the type of resource you are referencing. Env map[string]string `json:"env,omitempty"` // Queues is optionally present on a azure.servicebus.v0 resource, and is a list of queue names to create. Queues *[]string `json:"queues,omitempty"` // Topics is optionally present on a azure.servicebus.v0 resource, and is a list of topic names to create. Topics *[]string `json:"topics,omitempty"` // Some resources just represent connections to existing resources that need not be provisioned. These resources have // a "connectionString" property which is the connection string that should be used during binding. ConnectionString *string `json:"connectionString,omitempty"` // Dapr is present on dapr.v0 resources. Dapr *DaprResourceMetadata `json:"dapr,omitempty"` // DaprComponent is present on dapr.component.v0 resources. DaprComponent *DaprComponentResourceMetadata `json:"daprComponent,omitempty"` // Inputs is present on resources that need inputs from during the provisioning process (e.g asking for an API key, or // a password for a database). Inputs map[string]Input `json:"inputs,omitempty"` // For a bicep.v0 resource, defines the input parameters for the bicep file. Params map[string]any `json:"params,omitempty"` // parameter.v0 uses value field to define the value of the parameter. Value string // container.v0 uses volumes field to define the volumes of the container. Volumes []*Volume `json:"volumes,omitempty"` }