Documentation
¶
Index ¶
- func GlobalSpec(cluster string) (map[string]any, error)
- type AssetContext
- type ContextOption
- func WithBasePath(basePath string) ContextOption
- func WithCluster(cluster string) ContextOption
- func WithLogLevel(level logrus.Level) ContextOption
- func WithNamespace(namespace string) ContextOption
- func WithTimeout(timeout time.Duration) ContextOption
- func WithWorkPath(workPath string) ContextOption
- type ResourceContext
- type Spec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GlobalSpec ¶
GlobalSpec retrieves the global specification for a given cluster. It reads the specification from a YAML file located in a Google Cloud Storage bucket. The cluster parameter specifies the name of the cluster. The function returns a map[string]any containing the global specification and an error, if any.
Types ¶
type AssetContext ¶
type ContextOption ¶
type ContextOption func(*rcImpl)
func WithBasePath ¶
func WithBasePath(basePath string) ContextOption
func WithCluster ¶
func WithCluster(cluster string) ContextOption
func WithLogLevel ¶
func WithLogLevel(level logrus.Level) ContextOption
func WithNamespace ¶
func WithNamespace(namespace string) ContextOption
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ContextOption
func WithWorkPath ¶
func WithWorkPath(workPath string) ContextOption
type ResourceContext ¶
type ResourceContext interface { AssetContext Cluster() string Context() context.Context Namespace() string Timeout() time.Duration Logger() *logrus.Logger }
ResourceContext is an interface that extends the AssetContext interface and provides additional methods for accessing the cluster, context, namespace, timeout, and logger associated with a resource.
Methods: Cluster: Returns the cluster associated with the resource. Context: Returns the context associated with the resource. Namespace: Returns the namespace associated with the resource. Timeout: Returns the timeout duration for operations on the resource. Logger: Returns the logger associated with the resource.
func NewContext ¶
func NewContext(ctx context.Context, options ...ContextOption) ResourceContext
type Spec ¶
type Spec struct { Asset struct { Typ string `yaml:"type"` Release string `yaml:"release"` } `yaml:"asset"` App map[string]any `yaml:"app"` }
Spec represents a specification that includes information about an asset and an application. It is used to parse specifications from YAML files or other types of input data.
Fields: Asset: A struct that contains the type and release version of the asset. App: A map that contains application-specific data.
The Asset field is tagged with `yaml:"asset"` to specify the YAML name of the field. The App field is tagged with `yaml:"app"` to specify the YAML name of the field.