discovery

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscoveredRemoteService

type DiscoveredRemoteService struct {
	// URL holds the host name that returned the service discovery payload.
	// The URLs host can be different from the initial request host due to redirects.
	// It is the base URL for relative provider paths.
	URL url.URL
	WellKnownEndpointResponse
}

DiscoveredRemoteService holds the information retrieved during the discovery process

type Discovery

type Discovery struct {
	LoginV1     *LoginV1 `json:"login.v1,omitempty"`
	ModulesV1   string   `json:"modules.v1,omitempty"`
	ProvidersV1 string   `json:"providers.v1,omitempty"`
}

See https://developer.hashicorp.com/terraform/internals/remote-service-discovery

func New

func New(options ...Option) *Discovery

type LoginV1

type LoginV1 struct {
	Client     string   `json:"client,omitempty"`
	GrantTypes []string `json:"grant_types,omitempty"`
	Authz      string   `json:"authz,omitempty"`
	Token      string   `json:"token,omitempty"`
	Ports      []int    `json:"ports,omitempty"`
	Scopes     []string `json:"scopes,omitempty"`
}

type Option

type Option func(*Discovery)

func WithLoginV1

func WithLoginV1(login *LoginV1) Option

func WithModulesV1

func WithModulesV1(v string) Option

func WithProvidersV1

func WithProvidersV1(v string) Option

type RemoteServiceDiscovery

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

The RemoteServiceDiscovery struct caches HTTP path prefixes for providers which were discovered over the well-known service discovery mechanism. See: https://developer.hashicorp.com/terraform/internals/remote-service-discovery

func (*RemoteServiceDiscovery) Resolve

Resolve returns the relative provider path for a given URL

type ServiceDiscoveryResolver

type ServiceDiscoveryResolver interface {
	Resolve(ctx context.Context, host string) (*DiscoveredRemoteService, error)
}

func NewRemoteServiceDiscovery

func NewRemoteServiceDiscovery(client *http.Client) ServiceDiscoveryResolver

type WellKnownEndpointResponse

type WellKnownEndpointResponse struct {
	ModulesV1   string `json:"modules.v1,omitempty"`
	ProvidersV1 string `json:"providers.v1,omitempty"`
}

Jump to

Keyboard shortcuts

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