Documentation
¶
Overview ¶
Package datasource has the packages and logic that Waypoint uses for sourcing data for remote runs.
Index ¶
- Variables
- type GitSource
- func (s *GitSource) Get(ctx context.Context, log hclog.Logger, ui terminal.UI, raw *pb.Job_DataSource, ...) (string, func() error, error)
- func (s *GitSource) Override(raw *pb.Job_DataSource, m map[string]string) error
- func (s *GitSource) ProjectSource(body hcl.Body, ctx *hcl.EvalContext) (*pb.Job_DataSource, error)
- type LocalSource
- func (s *LocalSource) Get(ctx context.Context, log hclog.Logger, ui terminal.UI, raw *pb.Job_DataSource, ...) (string, func() error, error)
- func (s *LocalSource) Override(raw *pb.Job_DataSource, m map[string]string) error
- func (s *LocalSource) ProjectSource(body hcl.Body, ctx *hcl.EvalContext) (*pb.Job_DataSource, error)
- type Sourcer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // FromString maps a string key to a source implementation. FromString = map[string]func() Sourcer{ "git": newGitSource, "local": newLocalSource, } // FromType maps a server DataSource type to a source implementation. FromType = map[reflect.Type]func() Sourcer{ reflect.TypeOf((*pb.Job_DataSource_Git)(nil)): newGitSource, reflect.TypeOf((*pb.Job_DataSource_Local)(nil)): newLocalSource, } )
Functions ¶
This section is empty.
Types ¶
type GitSource ¶
type GitSource struct{}
func (*GitSource) ProjectSource ¶
func (s *GitSource) ProjectSource(body hcl.Body, ctx *hcl.EvalContext) (*pb.Job_DataSource, error)
type LocalSource ¶
type LocalSource struct{}
func (*LocalSource) Override ¶
func (s *LocalSource) Override(raw *pb.Job_DataSource, m map[string]string) error
func (*LocalSource) ProjectSource ¶
func (s *LocalSource) ProjectSource(body hcl.Body, ctx *hcl.EvalContext) (*pb.Job_DataSource, error)
type Sourcer ¶
type Sourcer interface { // ProjectSource translates the configuration into a default data // source for the project. This should also perform any validation // on the configuration. ProjectSource(hcl.Body, *hcl.EvalContext) (*pb.Job_DataSource, error) // Override reconfigures the given data source with the given overrides. Override(*pb.Job_DataSource, map[string]string) error // Get downloads the sourced data and returns the directory where // the data is stored, a cleanup function, and any errors that occurred. // The cleanup function may be nil. Get( ctx context.Context, log hclog.Logger, ui terminal.UI, source *pb.Job_DataSource, baseDir string, ) (string, func() error, error) }
Sourcer is implemented by all data sourcers and is responsible for sourcing data, configuring projects, determining the default values for operations, and more.
Click to show internal directories.
Click to hide internal directories.