schema

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 7 Imported by: 3 modules, 23 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMetadata added in v1.3.0

func AddMetadata(metadata map[string]string, key string, value *string)

Helper functions for metadata handling

func AddMetadataInt added in v1.3.0

func AddMetadataInt(metadata map[string]string, key string, value int)

func AddMetadataList added in v1.3.0

func AddMetadataList(metadata map[string]string, key string, values []*string)

Types

type ErrNoSuchKey

type ErrNoSuchKey struct {
	Name string
}

ErrNoSuchKey means no such key exists in metadata.

func (*ErrNoSuchKey) Error

func (e *ErrNoSuchKey) Error() string

Error returns the value of the metadata key

type OptionBlock

type OptionBlock map[string]string

OptionBlock is a single option on which operation is possible

func (OptionBlock) GetMetadata

func (o OptionBlock) GetMetadata(key string) (string, bool)

GetMetadata returns the value for a key if it exists.

func (OptionBlock) ResolveServices added in v1.5.0

func (o OptionBlock) ResolveServices(supported []string) ServiceMap

ResolveServices computes the effective service set for a provider from the option block. It starts from the `services` allowlist (falling back to all supported services when the allowlist is empty), then removes any `exclude_services` entries. Entries are whitespace-trimmed and values that are not in supported are ignored.

func (*OptionBlock) UnmarshalYAML added in v1.0.9

func (ob *OptionBlock) UnmarshalYAML(unmarshal func(interface{}) error) error

type Options

type Options []OptionBlock

Options contains configuration options for a provider

func (Options) GetExcludeServiceNames added in v1.5.0

func (o Options) GetExcludeServiceNames() []string

GetExcludeServiceNames returns the excluded services from the options

func (Options) GetServiceNames added in v1.2.1

func (o Options) GetServiceNames() []string

GetServiceNames returns the services from the options

type Provider

type Provider interface {
	// Name returns the name of the provider
	Name() string
	// ID returns the name of the provider id
	ID() string
	// Resources returns the provider for an resource deployment source.
	Resources(ctx context.Context) (*Resources, error)
	// Services returns the services provided by the Provider.
	// If no services set, it will return all the supported services.
	Services() []string
}

Provider is an interface implemented by any cloud service provider.

It provides the bare minimum of methods to allow complete overview of user data.

type Resource

type Resource struct {
	// Public specifies whether the asset is public facing or private
	Public bool `json:"public"`
	// Provider is the name of provider for instance
	Provider string `json:"provider"`
	// Service is the name of the service under the provider
	Service string `json:"service,omitempty"`
	// ID is the id name of the resource provider
	ID string `json:"id,omitempty"`
	// PublicIPv4 is the public ipv4 address of the instance.
	PublicIPv4 string `json:"public_ipv4,omitempty"`
	// PublicIPv6 is the public ipv6 address of the instance.
	PublicIPv6 string `json:"public_ipv6,omitempty"`
	// PrivateIpv4 is the private ipv4 address of the instance
	PrivateIpv4 string `json:"private_ipv4,omitempty"`
	// PrivateIpv6 is the private ipv6 address of the instance
	PrivateIpv6 string `json:"private_ipv6,omitempty"`
	// DNSName is the DNS name of the resource
	DNSName string `json:"dns_name,omitempty"`
	// Metadata is the additional metadata for the resource
	Metadata map[string]string `json:"metadata,omitempty"`
}

Resource is a cloud resource belonging to the organization

type ResourceDeduplicator added in v1.2.2

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

ResourceDeduplicator provides thread-safe deduplication for resources

func NewResourceDeduplicator added in v1.2.2

func NewResourceDeduplicator() *ResourceDeduplicator

NewResourceDeduplicator creates a new resource deduplicator

func (*ResourceDeduplicator) Add added in v1.2.2

func (d *ResourceDeduplicator) Add(value string) bool

Add adds a value to the deduplicator if it doesn't exist Returns true if the value was added (was unique)

func (*ResourceDeduplicator) Contains added in v1.2.2

func (d *ResourceDeduplicator) Contains(value string) bool

Contains checks if a value exists in the deduplicator

func (*ResourceDeduplicator) ProcessResource added in v1.2.2

func (d *ResourceDeduplicator) ProcessResource(resource *Resource) bool

ProcessResource adds a resource's values to deduplication and returns if any were new

type Resources

type Resources struct {
	Items []*Resource
	// contains filtered or unexported fields
}

Resources is a container of multiple resource returned from providers

func NewResources added in v1.0.0

func NewResources() *Resources

NewResources creates a new resources structure

func (*Resources) Append

func (r *Resources) Append(resource *Resource)

Append appends a single resource to the resource list

func (*Resources) Merge

func (r *Resources) Merge(resources *Resources)

Merge merges a list of resources into the main list

type ServiceMap added in v1.0.9

type ServiceMap map[string]struct{}

func (ServiceMap) Has added in v1.0.9

func (s ServiceMap) Has(service string) bool

func (ServiceMap) Keys added in v1.0.9

func (s ServiceMap) Keys() []string

type VerifiableProvider added in v1.2.2

type VerifiableProvider interface {
	Provider
	// Verify checks if the provider is valid
	Verify(ctx context.Context) error
}

VerifiableProvider is a Provider that can be verified with additional optional verification mechanism.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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