appstream

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 16 Imported by: 0

README

AppStream 2.0

Parity grade: A · SDK aws-sdk-go-v2/service/appstream@v1.60.3 · last audited 2026-07-12 (a7d6e20e)

Coverage

Metric Value
Operations audited 32 (32 ok)
Feature families 13 (13 ok)
Known gaps none
Deferred items 2
Resource leaks clean
Deferred
  • CreatedTime/StartTime wire encoding uses .Unix() (whole-second epoch int) instead of pkgs/awstime.Epoch() (fractional-second epoch float). Both are valid JSON numbers the real awsjson1.1 deserializer accepts, and the codebase is internally consistent (13 call sites), so this was left as a style note rather than "fixed" -- revisit only if sub-second CreatedTime ordering becomes a test requirement.
  • DescribeAppLicenseUsage is a deliberate always-empty stub (no license-usage backend state exists to report on); acceptable since it returns a real (empty) shape rather than a fabricated one, but flagged for anyone adding real license-usage tracking.

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when a resource does not exist.
	ErrNotFound = awserr.New(errResourceNotFound, awserr.ErrNotFound)
	// ErrAlreadyExists is returned when a resource already exists.
	ErrAlreadyExists = awserr.New(errResourceExists, awserr.ErrAlreadyExists)
	// ErrFleetNotStopped is returned when a fleet state transition is invalid
	// (e.g. starting a running fleet, stopping a stopped fleet, deleting a running fleet).
	ErrFleetNotStopped = awserr.New(errFleetNotStopped, awserr.ErrConflict)
	// ErrResourceInUse is returned when a resource cannot be deleted because it is in use.
	ErrResourceInUse = awserr.New(errResourceInUse, awserr.ErrConflict)
)
View Source
var ErrNilAppContext = errors.New("appstream: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

Functions

This section is empty.

Types

type AppBlock

type AppBlock struct {
	CreatedTime time.Time
	Tags        map[string]string
	Name        string
	Arn         string
	Description string
	State       string
}

AppBlock holds AppStream 2.0 app block details.

type AppBlockBuilder

type AppBlockBuilder struct {
	CreatedTime  time.Time
	Tags         map[string]string
	Name         string
	Arn          string
	Description  string
	Platform     string
	InstanceType string
	State        string
}

AppBlockBuilder holds AppStream 2.0 app block builder details.

type AppBlockBuilderAppBlockAssociation

type AppBlockBuilderAppBlockAssociation struct {
	AppBlockBuilderName string
	AppBlockArn         string
	State               string
}

AppBlockBuilderAppBlockAssociation represents an AppBlockBuilder-AppBlock link.

type Application

type Application struct {
	CreatedTime time.Time
	Tags        map[string]string
	Name        string
	Arn         string
	DisplayName string
	Description string
	LaunchPath  string
	AppBlockArn string
	Platforms   []string
}

Application holds AppStream 2.0 application details.

type ApplicationFleetAssociation

type ApplicationFleetAssociation struct {
	ApplicationArn string
	FleetName      string
	State          string
}

ApplicationFleetAssociation represents an Application-Fleet link.

type DirectoryConfig

type DirectoryConfig struct {
	CreatedTime                          time.Time
	DirectoryName                        string
	Arn                                  string
	OrganizationalUnitDistinguishedNames []string
}

DirectoryConfig holds Active Directory connection details.

type EntitledApplication

type EntitledApplication struct {
	ApplicationIdentifier string
}

EntitledApplication is an application visible to an entitled user.

type Entitlement

type Entitlement struct {
	CreatedTime    time.Time
	LastModifiedAt time.Time
	Name           string
	StackName      string
	Description    string
	AppVisibility  string
	Attributes     []EntitlementAttribute
}

Entitlement controls application access based on user attributes.

type EntitlementAttribute

type EntitlementAttribute struct {
	Name  string `json:"Name"`
	Value string `json:"Value"`
}

EntitlementAttribute is a name-value pair used for entitlement matching.

type ExportImageTask

type ExportImageTask struct {
	CreatedAt time.Time
	TaskID    string
	ImageName string
	S3Bucket  string
	S3Key     string
	Status    string
}

ExportImageTask represents an image export operation to S3.

type Fleet

type Fleet struct {
	EnableDefaultInternetAccess *bool
	CreatedTime                 time.Time
	Tags                        map[string]string
	Name                        string
	Arn                         string
	DisplayName                 string
	Description                 string
	InstanceType                string
	FleetType                   string
	State                       string
	ImageName                   string
	ImageArn                    string
	DesiredInstances            int
	MaxUserDurationSecs         int
	DisconnectTimeoutSecs       int
	IdleDisconnectTimeoutSecs   int
}

Fleet holds AppStream 2.0 fleet details.

type Handler

type Handler struct {
	Backend StorageBackend
	// contains filtered or unexported fields
}

Handler serves AppStream 2.0 JSON operations.

func NewHandler

func NewHandler(b StorageBackend) *Handler

NewHandler creates an AppStream 2.0 handler backed by b.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the AppStream action from the X-Amz-Target header.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(_ *echo.Context) string

ExtractResource returns an empty string (AppStream identifies resources by name in body).

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns all implemented operation names.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns header matching priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears backend state.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore restores the backend state from a snapshot.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher matches AppStream 2.0 X-Amz-Target headers.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot returns a serialized snapshot of the backend state.

type Image

type Image struct {
	CreatedTime  time.Time
	Tags         map[string]string
	Name         string
	Arn          string
	Description  string
	Platform     string
	Visibility   string
	State        string
	BaseImageArn string
}

Image holds AppStream 2.0 image details.

type ImageBuilder

type ImageBuilder struct {
	CreatedTime  time.Time
	Tags         map[string]string
	Name         string
	Arn          string
	Description  string
	Platform     string
	InstanceType string
	State        string
	ImageName    string
}

ImageBuilder holds AppStream 2.0 image builder details.

type ImagePermissions

type ImagePermissions struct {
	AllowFleet        bool
	AllowImageBuilder bool
}

ImagePermissions controls how an image may be used.

type InMemoryBackend

type InMemoryBackend struct {
	// contains filtered or unexported fields
}

InMemoryBackend implements StorageBackend using in-memory maps.

Every resource collection that is a map[string]*T is a *store.Table[T] (see store_setup.go), registered once on registry so Reset/Snapshot/ Restore collapse to one registry call each instead of one hand-written block per map (see pkgs/store's package doc, Phase 3.3 of the datalayer refactor). stacks, fleets, appBlocks, appBlockBuilders, applications, directoryConfigs, images, imageBuilders, exportTasks, and sessions were already flat and keyed by their own real identity field, so each registers directly with no composite key. entitlements and users were already keyed by a composite string (entitlementKey/userKey) built from two real fields each already carries (Name+StackName, UserName+AuthenticationType), so both also register directly -- the composite key is just their keyFn. themes is keyed directly by its own StackName field (one theme per stack). imagePermissions previously had no identity field of its own (it was always looked up by an external imageName); it gained a real (not hidden -- this type is purely internal, never marshaled as an AWS wire shape) Name field for this purpose, see storedImagePermissions in images.go.

associations, appBlockBuilderAssoc, appFleetAssoc, entitlementApps, softwareAssoc, and userStackAssoc are many-to-many association sets (map[string]map[string]bool); tags is map[string]map[string]string. None of these have a *T value store.Table could key on, so all seven remain plain maps, persisted directly by persistence.go (see its doc comment). usageReport is a single scalar record (not a map at all), so it also stays a plain field.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend constructs a new InMemoryBackend.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the account ID.

func (*InMemoryBackend) AssociateAppBlockBuilderAppBlock

func (b *InMemoryBackend) AssociateAppBlockBuilderAppBlock(builderName, appBlockID string) error

AssociateAppBlockBuilderAppBlock links a builder to an app block. appBlockID accepts either the app block Name or its Arn -- real AWS's AssociateAppBlockBuilderAppBlock request carries the AppBlockArn.

func (*InMemoryBackend) AssociateApplicationFleet

func (b *InMemoryBackend) AssociateApplicationFleet(appID, fleetName string) error

AssociateApplicationFleet links an application to a fleet. appID accepts either the application Name or its Arn -- real AWS's AssociateApplicationFleet request carries the ApplicationArn.

func (*InMemoryBackend) AssociateApplicationToEntitlement

func (b *InMemoryBackend) AssociateApplicationToEntitlement(appID, entitlementName, stackName string) error

AssociateApplicationToEntitlement links an application to an entitlement.

func (*InMemoryBackend) AssociateFleet

func (b *InMemoryBackend) AssociateFleet(fleetName, stackName string) error

AssociateFleet links a fleet and a stack.

func (*InMemoryBackend) AssociateSoftwareToImageBuilder

func (b *InMemoryBackend) AssociateSoftwareToImageBuilder(imageBuilderName string, software []string) error

AssociateSoftwareToImageBuilder adds software packages to an image builder.

func (*InMemoryBackend) BatchAssociateUserStack

func (b *InMemoryBackend) BatchAssociateUserStack(
	associations []UserStackAssociation,
) ([]UserStackAssociationError, error)

BatchAssociateUserStack links users to stacks.

func (*InMemoryBackend) BatchDisassociateUserStack

func (b *InMemoryBackend) BatchDisassociateUserStack(
	associations []UserStackAssociation,
) ([]UserStackAssociationError, error)

BatchDisassociateUserStack unlinks users from stacks.

func (*InMemoryBackend) CopyImage

func (b *InMemoryBackend) CopyImage(
	sourceName, destName, destRegion, description string,
) (*Image, error)

CopyImage duplicates an image with a new name.

func (*InMemoryBackend) CreateAppBlock

func (b *InMemoryBackend) CreateAppBlock(name, description string, tags map[string]string) (*AppBlock, error)

CreateAppBlock creates an app block.

func (*InMemoryBackend) CreateAppBlockBuilder

func (b *InMemoryBackend) CreateAppBlockBuilder(
	name, description, platform, instanceType string,
	tags map[string]string,
) (*AppBlockBuilder, error)

CreateAppBlockBuilder creates an app block builder.

func (*InMemoryBackend) CreateAppBlockBuilderStreamingURL

func (b *InMemoryBackend) CreateAppBlockBuilderStreamingURL(name string) (string, error)

CreateAppBlockBuilderStreamingURL returns a streaming URL for the builder.

func (*InMemoryBackend) CreateApplication

func (b *InMemoryBackend) CreateApplication(
	name, displayName, description, launchPath, appBlockArn string,
	platforms []string,
	tags map[string]string,
) (*Application, error)

CreateApplication creates a new application.

func (*InMemoryBackend) CreateDirectoryConfig

func (b *InMemoryBackend) CreateDirectoryConfig(
	name string,
	ouDNs []string,
) (*DirectoryConfig, error)

CreateDirectoryConfig creates a new directory configuration.

func (*InMemoryBackend) CreateEntitlement

func (b *InMemoryBackend) CreateEntitlement(
	name, stackName, description, appVisibility string,
	attributes []EntitlementAttribute,
) (*Entitlement, error)

CreateEntitlement creates a new entitlement.

func (*InMemoryBackend) CreateExportImageTask

func (b *InMemoryBackend) CreateExportImageTask(imageName, s3Bucket, s3Prefix string) (*ExportImageTask, error)

CreateExportImageTask creates an image export task.

func (*InMemoryBackend) CreateFleet

func (b *InMemoryBackend) CreateFleet(
	name, displayName, description, instanceType, fleetType, imageName, imageArn string,
	desiredInstances, maxUserDuration, disconnectTimeout, idleDisconnectTimeout int,
	enableDefaultInternetAccess *bool,
	tags map[string]string,
) (*Fleet, error)

CreateFleet creates a new fleet.

func (*InMemoryBackend) CreateImageBuilder

func (b *InMemoryBackend) CreateImageBuilder(
	name, description, platform, instanceType string,
	tags map[string]string,
) (*ImageBuilder, error)

CreateImageBuilder creates a new image builder.

func (*InMemoryBackend) CreateImageBuilderStreamingURL

func (b *InMemoryBackend) CreateImageBuilderStreamingURL(name string) (string, error)

CreateImageBuilderStreamingURL returns a streaming URL for an image builder.

func (*InMemoryBackend) CreateImportedImage

func (b *InMemoryBackend) CreateImportedImage(name, description string, tags map[string]string) (*Image, error)

CreateImportedImage creates a new image (e.g. imported from S3).

func (*InMemoryBackend) CreateStack

func (b *InMemoryBackend) CreateStack(name, displayName, description string, tags map[string]string) (*Stack, error)

CreateStack creates a new stack.

func (*InMemoryBackend) CreateStreamingURL

func (b *InMemoryBackend) CreateStreamingURL(stackName, fleetName, userID string) (string, error)

CreateStreamingURL creates a session and returns a streaming URL.

func (*InMemoryBackend) CreateThemeForStack

func (b *InMemoryBackend) CreateThemeForStack(stackName string) (*Theme, error)

CreateThemeForStack creates a theme for a stack.

func (*InMemoryBackend) CreateUpdatedImage

func (b *InMemoryBackend) CreateUpdatedImage(imageName, newImageName, description string) (*Image, error)

CreateUpdatedImage creates a new image based on an existing one with updates applied.

func (*InMemoryBackend) CreateUsageReportSubscription

func (b *InMemoryBackend) CreateUsageReportSubscription(schedule, s3Bucket string) (*UsageReportSubscription, error)

CreateUsageReportSubscription creates a usage report subscription.

func (*InMemoryBackend) CreateUser

func (b *InMemoryBackend) CreateUser(userName, email, firstName, lastName, authType string) (*User, error)

CreateUser creates a new UserPool user.

func (*InMemoryBackend) DeleteAppBlock

func (b *InMemoryBackend) DeleteAppBlock(name string) error

DeleteAppBlock removes an app block.

func (*InMemoryBackend) DeleteAppBlockBuilder

func (b *InMemoryBackend) DeleteAppBlockBuilder(name string) error

DeleteAppBlockBuilder removes an app block builder.

func (*InMemoryBackend) DeleteApplication

func (b *InMemoryBackend) DeleteApplication(name string) error

DeleteApplication removes an application.

func (*InMemoryBackend) DeleteDirectoryConfig

func (b *InMemoryBackend) DeleteDirectoryConfig(name string) error

DeleteDirectoryConfig removes a directory configuration.

func (*InMemoryBackend) DeleteEntitlement

func (b *InMemoryBackend) DeleteEntitlement(name, stackName string) error

DeleteEntitlement removes an entitlement.

func (*InMemoryBackend) DeleteFleet

func (b *InMemoryBackend) DeleteFleet(name string) error

DeleteFleet removes a fleet. Returns ErrResourceInUse if fleet is running.

func (*InMemoryBackend) DeleteImage

func (b *InMemoryBackend) DeleteImage(name string) error

DeleteImage removes an image.

func (*InMemoryBackend) DeleteImageBuilder

func (b *InMemoryBackend) DeleteImageBuilder(name string) (string, error)

DeleteImageBuilder removes an image builder and returns the image name (if any).

func (*InMemoryBackend) DeleteImagePermissions

func (b *InMemoryBackend) DeleteImagePermissions(imageName, accountID string) error

DeleteImagePermissions removes sharing permissions for a specific account.

func (*InMemoryBackend) DeleteStack

func (b *InMemoryBackend) DeleteStack(name string) error

DeleteStack removes a stack. Returns ErrResourceInUse if any fleet is associated with the stack.

func (*InMemoryBackend) DeleteThemeForStack

func (b *InMemoryBackend) DeleteThemeForStack(stackName string) error

DeleteThemeForStack removes a stack theme.

func (*InMemoryBackend) DeleteUsageReportSubscription

func (b *InMemoryBackend) DeleteUsageReportSubscription() error

DeleteUsageReportSubscription removes the usage report subscription.

func (*InMemoryBackend) DeleteUser

func (b *InMemoryBackend) DeleteUser(userName, authType string) error

DeleteUser removes a user.

func (*InMemoryBackend) DescribeAppBlockBuilderAppBlockAssociations

func (b *InMemoryBackend) DescribeAppBlockBuilderAppBlockAssociations(
	builderName, appBlockID string,
) ([]*AppBlockBuilderAppBlockAssociation, error)

DescribeAppBlockBuilderAppBlockAssociations lists builder-appblock associations. appBlockID accepts either the app block Name or its Arn, matching AssociateAppBlockBuilderAppBlock. A non-matching filter yields an empty result (real AWS's Describe op has no ResourceNotFoundException).

func (*InMemoryBackend) DescribeAppBlockBuilders

func (b *InMemoryBackend) DescribeAppBlockBuilders(names []string) ([]*AppBlockBuilder, error)

DescribeAppBlockBuilders returns builders, optionally filtered by name.

func (*InMemoryBackend) DescribeAppBlocks

func (b *InMemoryBackend) DescribeAppBlocks(arns []string) ([]*AppBlock, error)

DescribeAppBlocks returns app blocks, optionally filtered by ARN.

func (*InMemoryBackend) DescribeAppLicenseUsage

func (b *InMemoryBackend) DescribeAppLicenseUsage() ([]map[string]string, error)

DescribeAppLicenseUsage returns license usage (stub — always empty).

func (*InMemoryBackend) DescribeApplicationFleetAssociations

func (b *InMemoryBackend) DescribeApplicationFleetAssociations(
	appID, fleetName string,
) ([]*ApplicationFleetAssociation, error)

DescribeApplicationFleetAssociations returns application-fleet links. appID accepts either the application Name or its Arn, matching AssociateApplicationFleet. A non-matching filter yields an empty result (real AWS's Describe op has no ResourceNotFoundException).

func (*InMemoryBackend) DescribeApplications

func (b *InMemoryBackend) DescribeApplications(arns []string) ([]*Application, error)

DescribeApplications returns applications, optionally filtered by ARN.

func (*InMemoryBackend) DescribeDirectoryConfigs

func (b *InMemoryBackend) DescribeDirectoryConfigs(names []string) ([]*DirectoryConfig, error)

DescribeDirectoryConfigs returns directory configs, optionally filtered by name.

func (*InMemoryBackend) DescribeEntitlements

func (b *InMemoryBackend) DescribeEntitlements(name, stackName string) ([]*Entitlement, error)

DescribeEntitlements returns entitlements for a stack, optionally filtered by name.

func (*InMemoryBackend) DescribeFleets

func (b *InMemoryBackend) DescribeFleets(names []string) ([]*Fleet, error)

DescribeFleets returns fleets, optionally filtered by names.

func (*InMemoryBackend) DescribeImageBuilders

func (b *InMemoryBackend) DescribeImageBuilders(names []string) ([]*ImageBuilder, error)

DescribeImageBuilders returns image builders, optionally filtered by name.

func (*InMemoryBackend) DescribeImagePermissions

func (b *InMemoryBackend) DescribeImagePermissions(imageName string) ([]*SharedImagePermissions, error)

DescribeImagePermissions returns sharing permissions for an image.

func (*InMemoryBackend) DescribeImages

func (b *InMemoryBackend) DescribeImages(names []string) ([]*Image, error)

DescribeImages returns images, optionally filtered by name or ARN.

func (*InMemoryBackend) DescribeSessions

func (b *InMemoryBackend) DescribeSessions(stackName, fleetName, userID string) ([]*Session, error)

DescribeSessions returns sessions filtered by stack, fleet, and/or user.

func (*InMemoryBackend) DescribeSoftwareAssociations

func (b *InMemoryBackend) DescribeSoftwareAssociations(imageBuilderName string) ([]SoftwareAssociation, error)

DescribeSoftwareAssociations returns software associated with an image builder.

func (*InMemoryBackend) DescribeStacks

func (b *InMemoryBackend) DescribeStacks(names []string) ([]*Stack, error)

DescribeStacks returns stacks, optionally filtered by names.

func (*InMemoryBackend) DescribeThemeForStack

func (b *InMemoryBackend) DescribeThemeForStack(stackName string) (*Theme, error)

DescribeThemeForStack returns the theme for a stack.

func (*InMemoryBackend) DescribeUsageReportSubscriptions

func (b *InMemoryBackend) DescribeUsageReportSubscriptions() ([]*UsageReportSubscription, error)

DescribeUsageReportSubscriptions returns the usage report subscription.

func (*InMemoryBackend) DescribeUserStackAssociations

func (b *InMemoryBackend) DescribeUserStackAssociations(
	stackName, userName, authType string,
) ([]*UserStackAssociation, error)

DescribeUserStackAssociations returns user-stack links, optionally filtered.

func (*InMemoryBackend) DescribeUsers

func (b *InMemoryBackend) DescribeUsers(authType string) ([]*User, error)

DescribeUsers returns users, optionally filtered by authentication type.

func (*InMemoryBackend) DisableUser

func (b *InMemoryBackend) DisableUser(userName, authType string) error

DisableUser disables a user.

func (*InMemoryBackend) DisassociateAppBlockBuilderAppBlock

func (b *InMemoryBackend) DisassociateAppBlockBuilderAppBlock(builderName, appBlockID string) error

DisassociateAppBlockBuilderAppBlock removes a builder-appblock link. appBlockID accepts either the app block Name or its Arn, matching AssociateAppBlockBuilderAppBlock.

func (*InMemoryBackend) DisassociateApplicationFleet

func (b *InMemoryBackend) DisassociateApplicationFleet(appID, fleetName string) error

DisassociateApplicationFleet removes an application-fleet link. appID accepts either the application Name or its Arn, matching AssociateApplicationFleet.

func (*InMemoryBackend) DisassociateApplicationFromEntitlement

func (b *InMemoryBackend) DisassociateApplicationFromEntitlement(appID, entitlementName, stackName string) error

DisassociateApplicationFromEntitlement removes an application-entitlement link.

func (*InMemoryBackend) DisassociateFleet

func (b *InMemoryBackend) DisassociateFleet(fleetName, stackName string) error

DisassociateFleet unlinks a fleet and a stack.

func (*InMemoryBackend) DisassociateSoftwareFromImageBuilder

func (b *InMemoryBackend) DisassociateSoftwareFromImageBuilder(imageBuilderName string, software []string) error

DisassociateSoftwareFromImageBuilder removes software packages from an image builder.

func (*InMemoryBackend) DrainSessionInstance

func (b *InMemoryBackend) DrainSessionInstance(sessionID string) error

DrainSessionInstance removes a session.

func (*InMemoryBackend) EnableUser

func (b *InMemoryBackend) EnableUser(userName, authType string) error

EnableUser re-enables a user.

func (*InMemoryBackend) ExpireSession

func (b *InMemoryBackend) ExpireSession(sessionID string) error

ExpireSession marks a session as expired (and removes it).

func (*InMemoryBackend) GetExportImageTask

func (b *InMemoryBackend) GetExportImageTask(taskID string) (*ExportImageTask, error)

GetExportImageTask retrieves an export task by ID.

func (*InMemoryBackend) ListAssociatedFleets

func (b *InMemoryBackend) ListAssociatedFleets(stackName string) ([]string, error)

ListAssociatedFleets returns fleet names associated with a stack.

func (*InMemoryBackend) ListAssociatedStacks

func (b *InMemoryBackend) ListAssociatedStacks(fleetName string) ([]string, error)

ListAssociatedStacks returns stack names associated with a fleet.

func (*InMemoryBackend) ListEntitledApplications

func (b *InMemoryBackend) ListEntitledApplications(entitlementName, stackName string) ([]*EntitledApplication, error)

ListEntitledApplications returns applications associated with an entitlement.

func (*InMemoryBackend) ListExportImageTasks

func (b *InMemoryBackend) ListExportImageTasks(imageNames []string) ([]*ExportImageTask, error)

ListExportImageTasks returns export tasks, optionally filtered by image name.

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(arn string) (map[string]string, error)

ListTagsForResource returns tags for an AppStream resource ARN.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the region.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all state. Snapshot/Restore (and resetRawMaps, shared with Restore's version-mismatch path) live in persistence.go, alongside backendSnapshot, since both need the same registry/raw-map inventory this method resets.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore deserializes backend state from a snapshot. It implements persistence.Persistable.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serializes backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) StartAppBlockBuilder

func (b *InMemoryBackend) StartAppBlockBuilder(name string) error

StartAppBlockBuilder transitions a builder to RUNNING.

func (*InMemoryBackend) StartFleet

func (b *InMemoryBackend) StartFleet(name string) error

StartFleet transitions a fleet to RUNNING.

func (*InMemoryBackend) StartImageBuilder

func (b *InMemoryBackend) StartImageBuilder(
	name, appstreamAgentVersion string,
) (string, error)

StartImageBuilder transitions an image builder to RUNNING and returns a streaming URL.

func (*InMemoryBackend) StartSoftwareDeploymentToImageBuilder

func (b *InMemoryBackend) StartSoftwareDeploymentToImageBuilder(imageBuilderName string) error

StartSoftwareDeploymentToImageBuilder triggers a deployment (no-op for in-memory).

func (*InMemoryBackend) StopAppBlockBuilder

func (b *InMemoryBackend) StopAppBlockBuilder(name string) error

StopAppBlockBuilder transitions a builder to STOPPED. Idempotent: stopping an already-stopped builder succeeds (real AWS's StopAppBlockBuilder has no state-conflict exception -- only ConcurrentModificationException, OperationNotPermittedException, and ResourceNotFoundException).

func (*InMemoryBackend) StopFleet

func (b *InMemoryBackend) StopFleet(name string) error

StopFleet transitions a fleet to STOPPED. Idempotent: stopping an already-stopped fleet succeeds (real AWS's StopFleet has no state-conflict exception -- only ResourceNotFoundException and ConcurrentModificationException).

func (*InMemoryBackend) StopImageBuilder

func (b *InMemoryBackend) StopImageBuilder(name string) (*ImageBuilder, error)

StopImageBuilder transitions an image builder to STOPPED. Idempotent: stopping an already-stopped builder succeeds (real AWS's StopImageBuilder has no state-conflict exception -- only ConcurrentModificationException, OperationNotPermittedException, and ResourceNotFoundException).

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(arn string, tags map[string]string) error

TagResource applies tags to an AppStream resource ARN.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(arn string, keys []string) error

UntagResource removes tags from an AppStream resource ARN.

func (*InMemoryBackend) UpdateAppBlockBuilder

func (b *InMemoryBackend) UpdateAppBlockBuilder(name, description, instanceType string) (*AppBlockBuilder, error)

UpdateAppBlockBuilder updates mutable builder fields.

func (*InMemoryBackend) UpdateApplication

func (b *InMemoryBackend) UpdateApplication(name, displayName, description, launchPath string) (*Application, error)

UpdateApplication updates mutable application fields.

func (*InMemoryBackend) UpdateDirectoryConfig

func (b *InMemoryBackend) UpdateDirectoryConfig(
	name string,
	ouDNs []string,
) (*DirectoryConfig, error)

UpdateDirectoryConfig updates the OUs of a directory configuration.

func (*InMemoryBackend) UpdateEntitlement

func (b *InMemoryBackend) UpdateEntitlement(
	name, stackName, description, appVisibility string,
	attributes []EntitlementAttribute,
) (*Entitlement, error)

UpdateEntitlement updates mutable entitlement fields.

func (*InMemoryBackend) UpdateFleet

func (b *InMemoryBackend) UpdateFleet(
	name, displayName, description, instanceType, imageName, imageArn string,
	desiredInstances, maxUserDuration, disconnectTimeout, idleDisconnectTimeout int,
	enableDefaultInternetAccess *bool,
) (*Fleet, error)

UpdateFleet updates mutable fields of an existing fleet.

func (*InMemoryBackend) UpdateImagePermissions

func (b *InMemoryBackend) UpdateImagePermissions(
	imageName, accountID string,
	allowFleet, allowImageBuilder bool,
) error

UpdateImagePermissions sets sharing permissions for a specific account.

func (*InMemoryBackend) UpdateStack

func (b *InMemoryBackend) UpdateStack(name, displayName, description string) (*Stack, error)

UpdateStack updates mutable fields of an existing stack.

func (*InMemoryBackend) UpdateThemeForStack

func (b *InMemoryBackend) UpdateThemeForStack(stackName string) (*Theme, error)

UpdateThemeForStack updates the theme for a stack.

type Provider

type Provider struct{}

Provider implements service.Provider for Amazon AppStream 2.0.

func (*Provider) Init

Init initializes the AppStream 2.0 service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type Session

type Session struct {
	StartTime          time.Time
	ID                 string
	FleetName          string
	StackName          string
	UserID             string
	State              string
	ConnectionState    string
	AuthenticationType string
}

Session represents an active AppStream streaming session.

type SharedImagePermissions

type SharedImagePermissions struct {
	ImagePermissions *ImagePermissions
	SharedAccountID  string
}

SharedImagePermissions represents per-account sharing for an image.

type SoftwareAssociation

type SoftwareAssociation struct {
	ImageBuilderName string
	Software         string
}

SoftwareAssociation links a software package to an image builder.

type Stack

type Stack struct {
	CreatedTime time.Time
	Tags        map[string]string
	Name        string
	Arn         string
	DisplayName string
	Description string
}

Stack holds AppStream 2.0 stack details.

type StorageBackend

type StorageBackend interface {
	// Stacks
	CreateStack(name, displayName, description string, tags map[string]string) (*Stack, error)
	DescribeStacks(names []string) ([]*Stack, error)
	UpdateStack(name, displayName, description string) (*Stack, error)
	DeleteStack(name string) error

	// Fleets
	CreateFleet(name, displayName, description, instanceType, fleetType, imageName, imageArn string,
		desiredInstances, maxUserDuration, disconnectTimeout, idleDisconnectTimeout int,
		enableDefaultInternetAccess *bool, tags map[string]string) (*Fleet, error)
	DescribeFleets(names []string) ([]*Fleet, error)
	UpdateFleet(name, displayName, description, instanceType, imageName, imageArn string,
		desiredInstances, maxUserDuration, disconnectTimeout, idleDisconnectTimeout int,
		enableDefaultInternetAccess *bool) (*Fleet, error)
	DeleteFleet(name string) error
	StartFleet(name string) error
	StopFleet(name string) error

	// Fleet associations
	AssociateFleet(fleetName, stackName string) error
	DisassociateFleet(fleetName, stackName string) error
	ListAssociatedFleets(stackName string) ([]string, error)
	ListAssociatedStacks(fleetName string) ([]string, error)

	// Tags
	TagResource(arn string, tags map[string]string) error
	UntagResource(arn string, keys []string) error
	ListTagsForResource(arn string) (map[string]string, error)

	// AppBlocks
	CreateAppBlock(name, description string, tags map[string]string) (*AppBlock, error)
	DeleteAppBlock(name string) error
	DescribeAppBlocks(arns []string) ([]*AppBlock, error)

	// AppBlockBuilders
	CreateAppBlockBuilder(
		name, description, platform, instanceType string,
		tags map[string]string,
	) (*AppBlockBuilder, error)
	DeleteAppBlockBuilder(name string) error
	DescribeAppBlockBuilders(names []string) ([]*AppBlockBuilder, error)
	StartAppBlockBuilder(name string) error
	StopAppBlockBuilder(name string) error
	UpdateAppBlockBuilder(name, description, instanceType string) (*AppBlockBuilder, error)
	CreateAppBlockBuilderStreamingURL(name string) (string, error)

	// AppBlockBuilder-AppBlock associations. appBlockID accepts either the
	// app block Name or its Arn (real AWS's request carries AppBlockArn).
	AssociateAppBlockBuilderAppBlock(builderName, appBlockID string) error
	DisassociateAppBlockBuilderAppBlock(builderName, appBlockID string) error
	DescribeAppBlockBuilderAppBlockAssociations(
		builderName, appBlockID string,
	) ([]*AppBlockBuilderAppBlockAssociation, error)

	// Applications
	CreateApplication(name, displayName, description, launchPath, appBlockArn string,
		platforms []string, tags map[string]string) (*Application, error)
	DeleteApplication(name string) error
	DescribeApplications(arns []string) ([]*Application, error)
	UpdateApplication(name, displayName, description, launchPath string) (*Application, error)
	DescribeAppLicenseUsage() ([]map[string]string, error)

	// Application-Fleet associations. appID accepts either the application
	// Name or its Arn (real AWS's request carries ApplicationArn).
	AssociateApplicationFleet(appID, fleetName string) error
	DisassociateApplicationFleet(appID, fleetName string) error
	DescribeApplicationFleetAssociations(appID, fleetName string) ([]*ApplicationFleetAssociation, error)

	// Entitlements
	CreateEntitlement(name, stackName, description, appVisibility string,
		attributes []EntitlementAttribute) (*Entitlement, error)
	DeleteEntitlement(name, stackName string) error
	DescribeEntitlements(name, stackName string) ([]*Entitlement, error)
	UpdateEntitlement(name, stackName, description, appVisibility string,
		attributes []EntitlementAttribute) (*Entitlement, error)
	AssociateApplicationToEntitlement(appID, entitlementName, stackName string) error
	DisassociateApplicationFromEntitlement(appID, entitlementName, stackName string) error
	ListEntitledApplications(entitlementName, stackName string) ([]*EntitledApplication, error)

	// DirectoryConfigs
	CreateDirectoryConfig(
		name string,
		ouDNs []string,
	) (*DirectoryConfig, error)

	DeleteDirectoryConfig(name string) error
	DescribeDirectoryConfigs(names []string) ([]*DirectoryConfig, error)
	UpdateDirectoryConfig(
		name string,
		ouDNs []string,
	) (*DirectoryConfig, error)

	// Images
	CopyImage(sourceName, destName, destRegion, description string) (*Image, error)
	CreateImportedImage(name, description string, tags map[string]string) (*Image, error)
	CreateUpdatedImage(imageName, newImageName, description string) (*Image, error)
	DeleteImage(name string) error
	DescribeImages(names []string) ([]*Image, error)
	UpdateImagePermissions(imageName, accountID string, allowFleet, allowImageBuilder bool) error
	DeleteImagePermissions(imageName, accountID string) error
	DescribeImagePermissions(imageName string) ([]*SharedImagePermissions, error)

	// ImageBuilders
	CreateImageBuilder(name, description, platform, instanceType string, tags map[string]string) (*ImageBuilder, error)
	DeleteImageBuilder(name string) (string, error)
	DescribeImageBuilders(names []string) ([]*ImageBuilder, error)
	StartImageBuilder(name, appstreamAgentVersion string) (string, error)
	StopImageBuilder(name string) (*ImageBuilder, error)
	CreateImageBuilderStreamingURL(name string) (string, error)

	// Software associations
	AssociateSoftwareToImageBuilder(imageBuilderName string, software []string) error
	DisassociateSoftwareFromImageBuilder(imageBuilderName string, software []string) error
	DescribeSoftwareAssociations(imageBuilderName string) ([]SoftwareAssociation, error)
	StartSoftwareDeploymentToImageBuilder(imageBuilderName string) error

	// ExportImageTasks
	CreateExportImageTask(imageName, s3Bucket, s3Prefix string) (*ExportImageTask, error)
	GetExportImageTask(taskID string) (*ExportImageTask, error)
	ListExportImageTasks(imageNames []string) ([]*ExportImageTask, error)

	// UsageReportSubscriptions
	CreateUsageReportSubscription(schedule, s3Bucket string) (*UsageReportSubscription, error)
	DeleteUsageReportSubscription() error
	DescribeUsageReportSubscriptions() ([]*UsageReportSubscription, error)

	// Themes
	CreateThemeForStack(stackName string) (*Theme, error)
	DeleteThemeForStack(stackName string) error
	DescribeThemeForStack(stackName string) (*Theme, error)
	UpdateThemeForStack(stackName string) (*Theme, error)

	// Users
	CreateUser(userName, email, firstName, lastName, authType string) (*User, error)
	DeleteUser(userName, authType string) error
	DescribeUsers(authType string) ([]*User, error)
	DisableUser(userName, authType string) error
	EnableUser(userName, authType string) error

	// UserStack associations
	BatchAssociateUserStack(associations []UserStackAssociation) ([]UserStackAssociationError, error)
	BatchDisassociateUserStack(associations []UserStackAssociation) ([]UserStackAssociationError, error)
	DescribeUserStackAssociations(stackName, userName, authType string) ([]*UserStackAssociation, error)

	// Sessions
	DescribeSessions(stackName, fleetName, userID string) ([]*Session, error)
	DrainSessionInstance(sessionID string) error
	ExpireSession(sessionID string) error
	CreateStreamingURL(stackName, fleetName, userID string) (string, error)

	AccountID() string
	Region() string
	Reset()
	Snapshot(ctx context.Context) []byte
	Restore(ctx context.Context, data []byte) error
}

StorageBackend is the interface for AppStream 2.0 storage operations.

type Theme

type Theme struct {
	CreatedTime time.Time
	StackName   string
	State       string
}

Theme holds visual customisation for a stack.

type UsageReportSubscription

type UsageReportSubscription struct {
	S3BucketName string
	Schedule     string
}

UsageReportSubscription represents an AppStream usage report subscription.

type User

type User struct {
	CreatedTime        time.Time
	UserName           string
	Arn                string
	Email              string
	FirstName          string
	LastName           string
	AuthenticationType string
	Status             string
	Enabled            bool
}

User is an AppStream UserPool user.

type UserStackAssociation

type UserStackAssociation struct {
	UserName              string
	StackName             string
	AuthenticationType    string
	SendEmailNotification bool
}

UserStackAssociation links a user to a stack.

type UserStackAssociationError

type UserStackAssociationError struct {
	UserStackAssociation *UserStackAssociation
	ErrorCode            string
	ErrorMessage         string
}

UserStackAssociationError records a failed batch association.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL