Documentation
¶
Overview ¶
Package session provides project context loading for CLI commands.
Index ¶
Constants ¶
View Source
const ConfigFileName = "daco.yaml"
ConfigFileName is the name of the daco configuration file.
Variables ¶
View Source
var ( // ErrNotInitialized indicates no daco.yaml was found in the current directory. ErrNotInitialized = errors.New("not in a daco project (daco.yaml not found)") // ErrInvalidConfig indicates the config file exists but is invalid. ErrInvalidConfig = errors.New("invalid configuration") // ErrSpecNotFound indicates the spec file referenced by config doesn't exist. ErrSpecNotFound = errors.New("spec file not found") // ErrInvalidSpec indicates the spec file exists but couldn't be parsed. ErrInvalidSpec = errors.New("invalid OpenDPI spec") )
Functions ¶
Types ¶
type Context ¶
type Context struct {
// Config is the fully resolved configuration (with inheritance applied).
Config *config.Config
// Spec is the parsed OpenDPI specification.
Spec *opendpi.Spec
}
Context holds the resolved project configuration and parsed OpenDPI spec.
func From ¶
From extracts the daco Context from a context.Context. Returns nil if no Context is stored.
func FromCommand ¶
FromCommand extracts the daco Context from a cobra.Command's context. Returns nil if no Context is stored.
Click to show internal directories.
Click to hide internal directories.