provider

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBaseURL = "https://api.encore.dev"

Variables

This section is empty.

Functions

func New

func New(version string) func() provider.Provider

func NewCache added in v0.1.3

func NewCache() datasource.DataSource

func NewDatabase added in v0.1.3

func NewDatabase() datasource.DataSource

func NewEncoreDataSource

func NewEncoreDataSource(typeRef TypeRef, name, desc string, fragments ...string) datasource.DataSource

func NewGateway added in v0.1.3

func NewGateway() datasource.DataSource

func NewPubSubSubscription

func NewPubSubSubscription() datasource.DataSource

func NewPubSubTopic

func NewPubSubTopic() datasource.DataSource

func NewService added in v0.1.3

func NewService() datasource.DataSource

Types

type AWSAppLoadBalancer added in v0.1.3

type AWSAppLoadBalancer struct {
	Arn       string
	Listeners []AWSAppLoadBalancerListener
}

func (*AWSAppLoadBalancer) GetDocs added in v0.1.3

func (a *AWSAppLoadBalancer) GetDocs() map[string]string

type AWSAppLoadBalancerListener added in v0.1.3

type AWSAppLoadBalancerListener struct {
	Arn      string
	Port     int
	Protocol string
}

func (*AWSAppLoadBalancerListener) GetDocs added in v0.1.3

func (a *AWSAppLoadBalancerListener) GetDocs() map[string]string

type AWSDeadLetterQueue added in v0.1.3

type AWSDeadLetterQueue struct {
	Arn string
}

func (*AWSDeadLetterQueue) GetDocs added in v0.1.3

func (a *AWSDeadLetterQueue) GetDocs() (attrDesc map[string]string)

type AWSFargateCluster added in v0.1.3

type AWSFargateCluster struct {
	Arn string
}

func (*AWSFargateCluster) GetDocs added in v0.1.3

func (a *AWSFargateCluster) GetDocs() map[string]string

type AWSFargateService added in v0.1.3

type AWSFargateService struct {
	Arn            string
	Cluster        AWSFargateCluster
	Subnets        []AWSSubnet
	SecurityGroups []AWSSecurityGroup
}

func (*AWSFargateService) GetDocs added in v0.1.3

func (a *AWSFargateService) GetDocs() map[string]string

type AWSFargateTaskDefinition added in v0.1.3

type AWSFargateTaskDefinition struct {
	Arn           string
	Service       AWSFargateService
	TaskRole      AWSRole
	ExecutionRole AWSRole
	VPC           AWSVPC
}

func (*AWSFargateTaskDefinition) GetDocs added in v0.1.3

func (a *AWSFargateTaskDefinition) GetDocs() map[string]string

type AWSK8sCluster added in v0.1.3

type AWSK8sCluster struct {
	Arn           string
	Subnets       []AWSSubnet
	SecurityGroup AWSSecurityGroup
	Role          AWSRole
	VPC           AWSVPC
}

func (*AWSK8sCluster) GetDocs added in v0.1.3

func (a *AWSK8sCluster) GetDocs() map[string]string

type AWSParameterGroup added in v0.1.3

type AWSParameterGroup struct {
	Arn string
}

func (*AWSParameterGroup) GetDocs added in v0.1.3

func (a *AWSParameterGroup) GetDocs() map[string]string

type AWSRedisCluster added in v0.1.3

type AWSRedisCluster struct {
	Arn            string
	VPC            AWSVPC
	SubnetGroup    AWSSubnetGroup
	SecurityGroup  AWSSecurityGroup
	ParameterGroup AWSParameterGroup
}

func (*AWSRedisCluster) GetDocs added in v0.1.3

func (r *AWSRedisCluster) GetDocs() map[string]string

type AWSRedisParameterGroup added in v0.1.3

type AWSRedisParameterGroup struct {
	Arn string
}

func (*AWSRedisParameterGroup) GetDocs added in v0.1.3

func (r *AWSRedisParameterGroup) GetDocs() map[string]string

type AWSRole added in v0.1.3

type AWSRole struct {
	Arn string
}

func (*AWSRole) GetDocs added in v0.1.3

func (a *AWSRole) GetDocs() map[string]string

type AWSSNSSubscription added in v0.1.3

type AWSSNSSubscription struct {
	Arn                string
	WrappedAWSSNSTopic `graphql:"topic"`
	Queue              AWSSQSQueue
}

func (*AWSSNSSubscription) GetDocs added in v0.1.3

func (a *AWSSNSSubscription) GetDocs() (attrDesc map[string]string)

type AWSSNSTopic

type AWSSNSTopic struct {
	Arn string
}

func (*AWSSNSTopic) GetDocs

func (a *AWSSNSTopic) GetDocs() (attrDesc map[string]string)

type AWSSQLServer added in v0.1.3

type AWSSQLServer struct {
	Arn            string
	VPC            AWSVPC
	SubnetGroup    AWSSubnetGroup
	SecurityGroup  AWSSecurityGroup
	ParameterGroup AWSParameterGroup
}

func (*AWSSQLServer) GetDocs added in v0.1.3

func (a *AWSSQLServer) GetDocs() map[string]string

type AWSSQSQueue

type AWSSQSQueue struct {
	Arn        string
	DeadLetter AWSDeadLetterQueue `graphql:"dlq"`
}

func (*AWSSQSQueue) GetDocs

func (a *AWSSQSQueue) GetDocs() (attrDesc map[string]string)

type AWSSecurityGroup added in v0.1.3

type AWSSecurityGroup struct {
	ID string
}

func (*AWSSecurityGroup) GetDocs added in v0.1.3

func (a *AWSSecurityGroup) GetDocs() map[string]string

type AWSSubnet added in v0.1.3

type AWSSubnet struct {
	Arn string
	Az  string
	Vpc AWSVPC
}

func (AWSSubnet) GetDocs added in v0.1.3

func (a AWSSubnet) GetDocs() map[string]string

type AWSSubnetGroup added in v0.1.3

type AWSSubnetGroup struct {
	Arn     string
	Subnets []AWSSubnet
}

func (*AWSSubnetGroup) GetDocs added in v0.1.3

func (r *AWSSubnetGroup) GetDocs() map[string]string

type AWSVPC added in v0.1.3

type AWSVPC struct {
	ID string
}

func (*AWSVPC) GetDocs added in v0.1.3

func (a *AWSVPC) GetDocs() map[string]string

type ComputeInstance added in v0.1.3

type ComputeInstance struct {
	GcpCloudRun              GCPCloudRun              `graphql:"... on GCPCloudRun"`
	AwsFargateTaskDefinition AWSFargateTaskDefinition `graphql:"... on AWSFargateTaskDefinition"`
	K8sContainer             `graphql:"... on K8sContainer"`
}

func (*ComputeInstance) GetDocs added in v0.1.3

func (a *ComputeInstance) GetDocs() map[string]string

type EncoreDataSource

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

func (*EncoreDataSource) Configure

func (*EncoreDataSource) Metadata

func (*EncoreDataSource) Read

func (*EncoreDataSource) Schema

type EncoreProvider

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

EncoreProvider defines the provider implementation.

func (*EncoreProvider) Configure

func (*EncoreProvider) DataSources

func (p *EncoreProvider) DataSources(ctx context.Context) []func() datasource.DataSource

func (*EncoreProvider) Metadata

func (*EncoreProvider) Resources

func (p *EncoreProvider) Resources(ctx context.Context) []func() resource.Resource

func (*EncoreProvider) Schema

type EncoreProviderModel

type EncoreProviderModel struct {
	APIKey  types.String `tfsdk:"auth_key"`
	EnvName types.String `tfsdk:"env"`
}

EncoreProviderModel describes the provider data model.

type Error

type Error struct {
	HTTPStatus string `json:"-"`
	HTTPCode   int    `json:"-"`
	Code       string
	Detail     json.RawMessage
}

func (Error) Error

func (e Error) Error() string

type GCPCloudRun added in v0.1.3

type GCPCloudRun struct {
	SelfLink               string                    `tf:"id"`
	ServerlessVpcConnector GCPServerlessVpcConnector `graphql:"serverlessVPCConnector"`
	ServiceAccount         GCPServiceAccount
}

func (*GCPCloudRun) GetDocs added in v0.1.3

func (a *GCPCloudRun) GetDocs() map[string]string

type GCPDeadLetterQueue added in v0.1.3

type GCPDeadLetterQueue struct {
	SelfLink              string `tf:"id"`
	WrappedGCPPubSubTopic `graphql:"topic"`
}

func (*GCPDeadLetterQueue) GetDocs added in v0.1.3

func (a *GCPDeadLetterQueue) GetDocs() (attrDesc map[string]string)

type GCPK8sCluster added in v0.1.3

type GCPK8sCluster struct {
	SelfLink       string `tf:"id"`
	Network        GCPNetwork
	ServiceAccount GCPServiceAccount
	NodePools      []GCPK8sNodePool
}

func (*GCPK8sCluster) GetDocs added in v0.1.3

func (a *GCPK8sCluster) GetDocs() map[string]string

type GCPK8sNodePool added in v0.1.3

type GCPK8sNodePool struct {
	SelfLink string `tf:"id"`
}

func (*GCPK8sNodePool) GetDocs added in v0.1.3

func (a *GCPK8sNodePool) GetDocs() map[string]string

type GCPNetwork added in v0.1.3

type GCPNetwork struct {
	SelfLink string `tf:"id"`
}

func (*GCPNetwork) GetDocs added in v0.1.3

func (a *GCPNetwork) GetDocs() map[string]string

type GCPPubSubSubscription

type GCPPubSubSubscription struct {
	SelfLink              string `tf:"id"`
	WrappedGCPPubSubTopic `graphql:"topic"`
	DeadLetter            GCPDeadLetterQueue `graphql:"dlq"`
}

func (*GCPPubSubSubscription) GetDocs

func (a *GCPPubSubSubscription) GetDocs() (attrDesc map[string]string)

type GCPPubSubTopic

type GCPPubSubTopic struct {
	SelfLink string `tf:"id"`
}

func (*GCPPubSubTopic) GetDocs

func (a *GCPPubSubTopic) GetDocs() (attrDesc map[string]string)

type GCPRedisCluster added in v0.1.3

type GCPRedisCluster struct {
	SelfLink string `tf:"id"`
	Network  GCPNetwork
}

func (*GCPRedisCluster) GetDocs added in v0.1.3

func (r *GCPRedisCluster) GetDocs() map[string]string

type GCPSQLServer added in v0.1.3

type GCPSQLServer struct {
	SelfLink string `tf:"id"`
	Network  GCPNetwork
	SslCert  GCPSSLCert
}

func (*GCPSQLServer) GetDocs added in v0.1.3

func (a *GCPSQLServer) GetDocs() map[string]string

type GCPSSLCert added in v0.1.3

type GCPSSLCert struct {
	Fingerprint string
}

func (*GCPSSLCert) GetDocs added in v0.1.3

func (a *GCPSSLCert) GetDocs() map[string]string

type GCPServerlessVpcConnector added in v0.1.3

type GCPServerlessVpcConnector struct {
	SelfLink string `tf:"id"`
	Network  GCPNetwork
}

func (*GCPServerlessVpcConnector) GetDocs added in v0.1.3

func (a *GCPServerlessVpcConnector) GetDocs() map[string]string

type GCPServiceAccount added in v0.1.3

type GCPServiceAccount struct {
	SelfLink string `tf:"id"`
}

func (*GCPServiceAccount) GetDocs added in v0.1.3

func (a *GCPServiceAccount) GetDocs() map[string]string

type Gateway added in v0.1.3

type Gateway struct {
	ComputeInstance `graphql:"compute"`
	Route           `graphql:"route"`
	Ingress         `graphql:"ingress"`
}

type Ingress added in v0.1.3

type Ingress struct {
	K8sIngress K8sIngress         `graphql:"... on K8sIngress"`
	AwsAlb     AWSAppLoadBalancer `graphql:"... on AWSAppLoadBalancer"`
}

func (*Ingress) GetDocs added in v0.1.3

func (g *Ingress) GetDocs() map[string]string

type K8sCluster added in v0.1.3

type K8sCluster struct {
	GcpGke GCPK8sCluster `graphql:"... on GCPK8sCluster"`
	AwsEks AWSK8sCluster `graphql:"... on AWSK8sCluster"`
}

func (*K8sCluster) GetDocs added in v0.1.3

func (a *K8sCluster) GetDocs() map[string]string

type K8sClusterIP added in v0.1.3

type K8sClusterIP struct {
	K8sData `graphql:"data"`
}

type K8sContainer added in v0.1.3

type K8sContainer struct {
	K8sDeployment K8sDeployment `graphql:"deployment"`
}

func (*K8sContainer) GetDocs added in v0.1.3

func (a *K8sContainer) GetDocs() map[string]string

type K8sData added in v0.1.3

type K8sData struct {
	Name string
}

func (*K8sData) GetDocs added in v0.1.3

func (a *K8sData) GetDocs() map[string]string

type K8sDeployment added in v0.1.3

type K8sDeployment struct {
	K8sData        `graphql:"data"`
	Namespace      K8sNamespace
	ServiceAccount K8sServiceAccount
}

func (*K8sDeployment) GetDocs added in v0.1.3

func (a *K8sDeployment) GetDocs() map[string]string

type K8sIngress added in v0.1.3

type K8sIngress struct {
	K8sData `graphql:"data"`
}

type K8sNamespace added in v0.1.3

type K8sNamespace struct {
	K8sData    `graphql:"data"`
	K8sCluster `graphql:"cluster"`
}

type K8sServiceAccount added in v0.1.3

type K8sServiceAccount struct {
	K8sData             `graphql:"data"`
	K8sWorkloadIdentity `graphql:"workloadIdentity"`
}

type K8sWorkloadIdentity added in v0.1.3

type K8sWorkloadIdentity struct {
	GcpServiceAccount GCPServiceAccount `graphql:"... on GCPServiceAccount"`
	AwsRole           AWSRole           `graphql:"... on AWSRole"`
}

func (*K8sWorkloadIdentity) GetDocs added in v0.1.3

func (a *K8sWorkloadIdentity) GetDocs() map[string]string

type Need

type Need struct {
	ID         string
	TypeRef    TypeRef
	EncoreName string
	Satisfier  *SatisfierQuery
}

type NeedsData

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

func NewNeedsData

func NewNeedsData(client PlatformClient, envName string, ds []func() datasource.DataSource) *NeedsData

func (*NeedsData) Get

func (n *NeedsData) Get(ctx context.Context, typRef TypeRef, envName, encoreName string) (*Need, diag.Diagnostics)

func (*NeedsData) SetValue

func (s *NeedsData) SetValue(ctx context.Context, typRef TypeRef, reqCfg tfsdk.Config, state *tfsdk.State) diag.Diagnostics

type OAuthData

type OAuthData struct {
	Token   *oauth2.Token `json:"token"`
	Actor   string        `json:"actor,omitempty"` // The ID of the user or app that authorized the token.
	Email   string        `json:"email"`           // empty if logging in as an app
	AppSlug string        `json:"app_slug"`        // empty if logging in as a user
}

type PlatformClient

type PlatformClient interface {
	Auth(ctx context.Context, authKey string) error
	Call(ctx context.Context, method, path string, reqParams, respParams interface{}) error
	GQL() *graphql.Client
	AppSlug() string
}

func NewPlatformClient

func NewPlatformClient(version string) PlatformClient

type PlatformClientImpl added in v0.1.3

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

func (*PlatformClientImpl) AppSlug added in v0.1.3

func (p *PlatformClientImpl) AppSlug() string

func (*PlatformClientImpl) Auth added in v0.1.3

func (p *PlatformClientImpl) Auth(ctx context.Context, authKey string) error

func (*PlatformClientImpl) Call added in v0.1.3

func (p *PlatformClientImpl) Call(ctx context.Context, method, path string, reqParams, respParams interface{}) (err error)

Call makes a call to the API endpoint given by method and path. If reqParams and respParams are non-nil they are JSON-marshalled/unmarshalled.

func (*PlatformClientImpl) Do added in v0.1.3

func (*PlatformClientImpl) GQL added in v0.1.3

func (p *PlatformClientImpl) GQL() *graphql.Client

type RedisCluster added in v0.1.3

type RedisCluster struct {
	AwsRedis AWSRedisCluster `graphql:"... on AWSRedisCluster"`
	GcpRedis GCPRedisCluster `graphql:"... on GCPRedisCluster"`
}

func (*RedisCluster) GetDocs added in v0.1.3

func (r *RedisCluster) GetDocs() map[string]string

type RedisKeyspace added in v0.1.3

type RedisKeyspace struct {
	RedisCluster `graphql:"cluster"`
}

type Route added in v0.1.3

type Route struct {
	K8sClusterIP K8sClusterIP `graphql:"... on K8sClusterIP"`
}

func (*Route) GetDocs added in v0.1.3

func (a *Route) GetDocs() map[string]string

type SQLDatabase added in v0.1.3

type SQLDatabase struct {
	SQLDatabaseName `graphql:"data"`
	SQLServer       `graphql:"server"`
}

type SQLDatabaseName added in v0.1.3

type SQLDatabaseName struct {
	Name string `tf:"database_name"`
}

func (*SQLDatabaseName) GetDocs added in v0.1.3

func (a *SQLDatabaseName) GetDocs() map[string]string

type SQLServer added in v0.1.3

type SQLServer struct {
	AwsRds      AWSSQLServer `graphql:"... on AWSSQLServer"`
	GcpCloudSQL GCPSQLServer `graphql:"... on GCPSQLServer"`
}

func (*SQLServer) GetDocs added in v0.1.3

func (a *SQLServer) GetDocs() map[string]string

type SatisfierQuery added in v0.1.3

type SatisfierQuery struct {
	Type string `graphql:"__typename"`

	AWSSNSSubscription    AWSSNSSubscription    `graphql:"... on AWSSNSSubscription" tf:"aws_sns"`
	GCPPubSubSubscription GCPPubSubSubscription `graphql:"... on GCPPubSubSubscription" tf:"gcp_pubsub"`

	AWSSNSTopic    AWSSNSTopic    `graphql:"... on AWSSNSTopic" tf:"aws_sns"`
	GCPPubSubTopic GCPPubSubTopic `graphql:"... on GCPPubSubTopic" tf:"gcp_pubsub"`

	SQLDatabase `graphql:"... on SQLDatabase"`

	RedisKeyspace `graphql:"... on RedisKeyspace"`

	Service `graphql:"... on Service"`

	Gateway `graphql:"... on Gateway"`
}

func (*SatisfierQuery) GetDocs added in v0.1.3

func (a *SatisfierQuery) GetDocs() (attrDesc map[string]string)

type Service added in v0.1.3

type Service struct {
	ComputeInstance `graphql:"compute"`
	Route           `graphql:"route"`
}

type TerraformDescription added in v0.1.3

type TerraformDescription interface {
	GetDocs() (attrDesc map[string]string)
}

type TypeRef

type TypeRef string

type WrappedAWSSNSTopic added in v0.1.3

type WrappedAWSSNSTopic struct {
	Topic AWSSNSTopic `graphql:"... on AWSSNSTopic"`
}

func (*WrappedAWSSNSTopic) GetDocs added in v0.1.3

func (a *WrappedAWSSNSTopic) GetDocs() (attrDesc map[string]string)

type WrappedGCPPubSubTopic added in v0.1.3

type WrappedGCPPubSubTopic struct {
	Topic GCPPubSubTopic `graphql:"... on GCPPubSubTopic"`
}

Jump to

Keyboard shortcuts

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