Documentation ¶
Index ¶
- Constants
- Variables
- type CUETemplater
- type ExternalProviderFn
- type GenericProviderFn
- type NativeProviderFn
- type Package
- type PackageManager
- func (in *PackageManager) GetImports() []*build.Instance
- func (in *PackageManager) GetPackages() []Package
- func (in *PackageManager) GetProviders() map[string]Provider
- func (in *PackageManager) ListenExternalPackages(stopCh <-chan struct{})
- func (in *PackageManager) LoadExternalPackages(ctx context.Context) error
- func (in *PackageManager) LoadInternalPackages(pkgs ...Package)
- type PackageManagerOption
- type Provider
- type ProviderFn
- type WithInternalPackage
- type WithResyncPeriod
Constants ¶
const (
// VelaPrefix default prefix for internal package names
ShipPrefix = "ship/"
)
Variables ¶
var DefaultClient = singleton.NewSingleton(func() *http.Client { return &http.Client{ Transport: &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: DefaultClientInsecureSkipVerify}, }, } })
DefaultClient client for dealing requests
var DefaultClientInsecureSkipVerify = true
DefaultClientInsecureSkipVerify set if the default external provider client use insecure-skip-verify
Functions ¶
This section is empty.
Types ¶
type CUETemplater ¶
type CUETemplater interface { GetName() string GetPath() string GetTemplates() []string GetImports() []*build.Instance }
CUETemplater the interface for retrieving cue templates and imports
type ExternalProviderFn ¶
ExternalProviderFn external provider that implements ProviderFn interface
type GenericProviderFn ¶
GenericProviderFn generic function that implements ProviderFn interface
type NativeProviderFn ¶
NativeProviderFn native function that implements ProviderFn interface
type Package ¶
type Package interface { Provider CUETemplater }
Package composed by Provider & CUETemplater, the atomic unit for engine to use
func NewExternalPackage ¶
NewExternalPackage create Package based on given CRD object
func NewInternalPackage ¶
NewInternalPackage create package based on given functions
type PackageManager ¶
type PackageManager struct { Internals *maps.SyncMap[string, Package] Externals *maps.SyncMap[string, Package] ResyncPeriod time.Duration StopCh chan struct{} }
PackageManager manages cue packages
func NewPackageManager ¶
func NewPackageManager(opts ...PackageManagerOption) *PackageManager
NewPackageManager create PackageManager with given options
func (*PackageManager) GetImports ¶
func (in *PackageManager) GetImports() []*build.Instance
GetImports return all build.Instances built by given packages
func (*PackageManager) GetPackages ¶
func (in *PackageManager) GetPackages() []Package
GetPackages return all internal and external packages
func (*PackageManager) GetProviders ¶
func (in *PackageManager) GetProviders() map[string]Provider
GetProviders return all providers provisioned by given packages
func (*PackageManager) ListenExternalPackages ¶
func (in *PackageManager) ListenExternalPackages(stopCh <-chan struct{})
ListenExternalPackages start informer to listen external package changes
func (*PackageManager) LoadExternalPackages ¶
func (in *PackageManager) LoadExternalPackages(ctx context.Context) error
LoadExternalPackages load all external packages
func (*PackageManager) LoadInternalPackages ¶
func (in *PackageManager) LoadInternalPackages(pkgs ...Package)
LoadInternalPackages load given internal packages
type PackageManagerOption ¶
type PackageManagerOption interface {
ApplyTo(*PackageManager)
}
PackageManagerOption option for configuring PackageManager
type Provider ¶
type Provider interface { GetName() string GetProviderFn(do string) ProviderFn }
Provider the interface to get provider function
type ProviderFn ¶
ProviderFn the function interface to process cue values
type WithInternalPackage ¶
type WithInternalPackage struct {
Package
}
WithInternalPackage add internal package
func (WithInternalPackage) ApplyTo ¶
func (in WithInternalPackage) ApplyTo(m *PackageManager)
ApplyTo .
type WithResyncPeriod ¶
WithResyncPeriod set resync period for external package informer