provider

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MPL-2.0 Imports: 23 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 NewEncoreDataSource

func NewEncoreDataSource(typeRef TypeRef, name string, tfTypes ...TFType) datasource.DataSource

func NewPubSubSubscription

func NewPubSubSubscription() datasource.DataSource

func NewPubSubTopic

func NewPubSubTopic() datasource.DataSource

Types

type AWSSNSTopic

type AWSSNSTopic struct {
	Arn string
}

func (*AWSSNSTopic) GetDocs

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

type AWSSQSQueue

type AWSSQSQueue struct {
	Arn string
}

func (*AWSSQSQueue) GetDocs

func (a *AWSSQSQueue) GetDocs() (subkey string, mdDesc string, attrDesc 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 GCPPubSubSubscription

type GCPPubSubSubscription struct {
	SelfLink string `tfsdk:"relative_resource_name"`
}

func (*GCPPubSubSubscription) GetDocs

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

type GCPPubSubTopic

type GCPPubSubTopic struct {
	SelfLink string `tfsdk:"relative_resource_name"`
}

func (*GCPPubSubTopic) GetDocs

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

type Need

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

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 struct {
	// contains filtered or unexported fields
}

func NewPlatformClient

func NewPlatformClient(version string) *PlatformClient

func (*PlatformClient) Auth

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

func (*PlatformClient) Call

func (p *PlatformClient) 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 (*PlatformClient) Do

func (p *PlatformClient) Do(req *http.Request) (*http.Response, error)

type Satisfier

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

	AWSSQSQueue           `graphql:"... on AWSSQSQueue"`
	GCPPubSubSubscription `graphql:"... on GCPPubSubSubscription"`

	GCPPubSubTopic `graphql:"... on GCPPubSubTopic"`
	AWSSNSTopic    `graphql:"... on AWSSNSTopic"`
}

func (*Satisfier) GetData

func (s *Satisfier) GetData() (TFType, diag.Diagnostics)

type TFType

type TFType interface {
	GetDocs() (subkey string, mdDesc string, attrDesc map[string]string)
}

type TypeRef

type TypeRef string

Jump to

Keyboard shortcuts

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