Documentation ¶
Index ¶
Constants ¶
const ( BlockImportFile = "import.file" BlockImportString = "import.string" BlockImportHTTP = "import.http" BlockImportGit = "import.git" )
Variables ¶
var DefaultFileArguments = FileArguments{ Type: file.DetectorFSNotify, PollFrequency: time.Minute, }
var DefaultGitArguments = GitArguments{ Revision: "HEAD", PullFrequency: time.Minute, }
var DefaultHTTPArguments = HTTPArguments{ PollFrequency: 1 * time.Minute, PollTimeout: 10 * time.Second, Client: common_config.DefaultHTTPClientConfig, Method: http.MethodGet, }
DefaultHTTPArguments holds default settings for HTTPArguments.
Functions ¶
This section is empty.
Types ¶
type FileArguments ¶
type FileArguments struct { // Filename indicates the file to watch. Filename string `river:"filename,attr"` // Type indicates how to detect changes to the file. Type file.Detector `river:"detector,attr,optional"` // PollFrequency determines the frequency to check for changes when Type is Poll. PollFrequency time.Duration `river:"poll_frequency,attr,optional"` }
FileArguments holds values which are used to configure the local.file component.
type GitArguments ¶
type GitArguments struct { Repository string `river:"repository,attr"` Revision string `river:"revision,attr,optional"` Path string `river:"path,attr"` PullFrequency time.Duration `river:"pull_frequency,attr,optional"` GitAuthConfig vcs.GitAuthConfig `river:",squash"` }
func (*GitArguments) SetToDefault ¶
func (args *GitArguments) SetToDefault()
SetToDefault implements river.Defaulter.
type HTTPArguments ¶
type HTTPArguments struct { URL string `river:"url,attr"` PollFrequency time.Duration `river:"poll_frequency,attr,optional"` PollTimeout time.Duration `river:"poll_timeout,attr,optional"` Method string `river:"method,attr,optional"` Headers map[string]string `river:"headers,attr,optional"` Body string `river:"body,attr,optional"` Client common_config.HTTPClientConfig `river:"client,block,optional"` }
HTTPArguments holds values which are used to configure the remote.http component.
func (*HTTPArguments) SetToDefault ¶
func (args *HTTPArguments) SetToDefault()
SetToDefault implements river.Defaulter.
type ImportFile ¶
type ImportFile struct {
// contains filtered or unexported fields
}
ImportFile imports a module from a file via the local.file component.
func NewImportFile ¶
func (*ImportFile) CurrentHealth ¶
func (im *ImportFile) CurrentHealth() component.Health
CurrentHealth returns the health of the file component.
type ImportGit ¶
type ImportGit struct {
// contains filtered or unexported fields
}
ImportGit imports a module from a git repository. There are currently no remote.git component, the logic is implemented here.
func NewImportGit ¶
func (*ImportGit) CurrentHealth ¶
CurrentHealth implements component.HealthComponent.
type ImportHTTP ¶
type ImportHTTP struct {
// contains filtered or unexported fields
}
ImportHTTP imports a module from a HTTP server via the remote.http component.
func NewImportHTTP ¶
func (*ImportHTTP) CurrentHealth ¶
func (im *ImportHTTP) CurrentHealth() component.Health
type ImportSource ¶
type ImportSource interface { // Evaluate updates the arguments provided via the River block. Evaluate(scope *vm.Scope) error // Run the underlying source to be updated when the content changes. Run(ctx context.Context) error // CurrentHealth returns the current Health status of the running source. CurrentHealth() component.Health }
ImportSource retrieves a module from a source.
func NewImportSource ¶
func NewImportSource(sourceType SourceType, managedOpts component.Options, eval *vm.Evaluator, onContentChange func(string)) ImportSource
NewImportSource creates a new ImportSource depending on the type. onContentChange is used by the source when it receives new content.
type ImportString ¶
type ImportString struct {
// contains filtered or unexported fields
}
ImportString imports a module from a string.
func NewImportString ¶
func NewImportString(eval *vm.Evaluator, onContentChange func(string)) *ImportString
func (*ImportString) CurrentHealth ¶
func (im *ImportString) CurrentHealth() component.Health
ImportString is always healthy
type SourceType ¶
type SourceType int
const ( File SourceType = iota String Git HTTP )
func GetSourceType ¶
func GetSourceType(fullName string) SourceType
GetSourceType returns a SourceType matching a source name.