Documentation
¶
Index ¶
- func NewAWSAdapter(config types.Configuration) ports.AWS
- type AWSSDK
- type CredentialMicroservice
- func (svc CredentialMicroservice) DisableCredential(ctx context.Context, actor, emulator, ID string) error
- func (svc CredentialMicroservice) GetCredential(ctx context.Context, actor, emulator, ID string) (*types.Credential, error)
- func (svc CredentialMicroservice) ListCredentials(ctx context.Context, actor, emulator string) ([]service.CredentialModel, error)
- func (svc CredentialMicroservice) ListCredentialsByTag(ctx context.Context, actor, emulator, tagName string) ([]types.Credential, error)
- type EventAdapter
- type EventOut
- func (e EventOut) EventApplicationCredentialsCreateFailed(response providers.CreateApplicationCredentialResponse)
- func (e EventOut) EventApplicationCredentialsCreated(response providers.CreateApplicationCredentialResponse)
- func (e EventOut) EventApplicationCredentialsDeleteFailed(response providers.DeleteApplicationCredentialResponse)
- func (e EventOut) EventApplicationCredentialsDeleted(response providers.DeleteApplicationCredentialResponse)
- func (e EventOut) Nothing()
- type ProviderMetadataClient
- type QueryAdapter
- type WorkspaceMicroservice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAWSAdapter ¶
func NewAWSAdapter(config types.Configuration) ports.AWS
NewAWSAdapter creates a new AWS adapter
Types ¶
type AWSSDK ¶
type AWSSDK interface { DescribeImages(ctx context.Context, param *ec2.DescribeImagesInput, optFn ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error) DescribeInstanceTypes(ctx context.Context, param *ec2.DescribeInstanceTypesInput, optFn ...func(*ec2.Options)) (*ec2.DescribeInstanceTypesOutput, error) DescribeRegions(ctx context.Context, param *ec2.DescribeRegionsInput, optFn ...func(*ec2.Options)) (*ec2.DescribeRegionsOutput, error) GetCallerIdentity(ctx context.Context, params *sts.GetCallerIdentityInput, optFns ...func(*sts.Options)) (*sts.GetCallerIdentityOutput, error) }
AWSSDK is an interface that has all the methods that will be used by awsAdapter. ec2.Client implements this interface. This interface is created to separate the adapter from the AWS sdk, thus allow mocking the AWS sdk for unit testing.
type CredentialMicroservice ¶
type CredentialMicroservice struct {
// contains filtered or unexported fields
}
CredentialMicroservice ...
func NewCredentialMicroservice ¶
func NewCredentialMicroservice(queryConn messaging2.QueryConnection, eventConn messaging2.EventConnection) *CredentialMicroservice
NewCredentialMicroservice ...
func (CredentialMicroservice) DisableCredential ¶
func (svc CredentialMicroservice) DisableCredential(ctx context.Context, actor, emulator, ID string) error
DisableCredential ...
func (CredentialMicroservice) GetCredential ¶
func (svc CredentialMicroservice) GetCredential(ctx context.Context, actor, emulator, ID string) (*types.Credential, error)
GetCredential ...
func (CredentialMicroservice) ListCredentials ¶
func (svc CredentialMicroservice) ListCredentials(ctx context.Context, actor, emulator string) ([]service.CredentialModel, error)
ListCredentials ...
func (CredentialMicroservice) ListCredentialsByTag ¶
func (svc CredentialMicroservice) ListCredentialsByTag(ctx context.Context, actor, emulator, tagName string) ([]types.Credential, error)
ListCredentialsByTag ...
type EventAdapter ¶
type EventAdapter struct {
// contains filtered or unexported fields
}
EventAdapter communicates to IncomingEventPort
func NewEventAdapter ¶
func NewEventAdapter(conn messaging2.EventConnection) *EventAdapter
NewEventAdapter ...
func (*EventAdapter) SetHandlers ¶
func (adapter *EventAdapter) SetHandlers(handlers ports.IncomingEventHandlers)
SetHandlers sets the mapping of event type to event handlers
type EventOut ¶
type EventOut struct {
// contains filtered or unexported fields
}
EventOut implements ports.OutgoingEvents, this will be pass as argument to ports.IncomingEventHandlers
func (EventOut) EventApplicationCredentialsCreateFailed ¶
func (e EventOut) EventApplicationCredentialsCreateFailed(response providers.CreateApplicationCredentialResponse)
EventApplicationCredentialsCreateFailed ...
func (EventOut) EventApplicationCredentialsCreated ¶
func (e EventOut) EventApplicationCredentialsCreated(response providers.CreateApplicationCredentialResponse)
EventApplicationCredentialsCreated ...
func (EventOut) EventApplicationCredentialsDeleteFailed ¶
func (e EventOut) EventApplicationCredentialsDeleteFailed(response providers.DeleteApplicationCredentialResponse)
EventApplicationCredentialsDeleteFailed ...
func (EventOut) EventApplicationCredentialsDeleted ¶
func (e EventOut) EventApplicationCredentialsDeleted(response providers.DeleteApplicationCredentialResponse)
EventApplicationCredentialsDeleted ...
type ProviderMetadataClient ¶
type ProviderMetadataClient struct {
// contains filtered or unexported fields
}
ProviderMetadataClient ...
func NewProviderMetadataClient ¶
func NewProviderMetadataClient(queryConn messaging2.QueryConnection) *ProviderMetadataClient
NewProviderMetadataClient ...
func (ProviderMetadataClient) GetMetadata ¶
func (svc ProviderMetadataClient) GetMetadata(ctx context.Context, actor, emulator string, providerID common.ID) (map[string]interface{}, error)
GetMetadata fetches metadata for a provider
func (ProviderMetadataClient) ListAWSProviders ¶
func (svc ProviderMetadataClient) ListAWSProviders(ctx context.Context, actor, emulator string) ([]service.ProviderModel, error)
ListAWSProviders lists all AWS provider that user can access.
type QueryAdapter ¶
type QueryAdapter struct {
// contains filtered or unexported fields
}
QueryAdapter implements ports.IncomingQueryPort & ports.OutgoingQueryPort
func (*QueryAdapter) Init ¶
func (adapter *QueryAdapter) Init(conf types.Configuration)
Init perform initialization on the adapter
func (*QueryAdapter) SetHandlers ¶
func (adapter *QueryAdapter) SetHandlers(handlers ports.IncomingQueryHandlers)
SetHandlers ...
type WorkspaceMicroservice ¶
type WorkspaceMicroservice struct {
// contains filtered or unexported fields
}
WorkspaceMicroservice ...
func NewWorkspaceMicroservice ¶
func NewWorkspaceMicroservice(queryConn messaging2.QueryConnection, eventConn messaging2.EventConnection) WorkspaceMicroservice
NewWorkspaceMicroservice ...
func (WorkspaceMicroservice) CreateWorkspaceForProviderAsync ¶
func (svc WorkspaceMicroservice) CreateWorkspaceForProviderAsync(ctx context.Context, actor, emulator string, providerID common.ID) error
CreateWorkspaceForProviderAsync creates workspace for a user for a provider. The creation is async, it only sends the request, it does not wait for the response.
Creating workspace using the default name, since the combination of (owner, name, default_provider_id) is unique (checked by the DB index), so if the workspace already exists, new workspace won't be created, this makes the operation idempotent.