source

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2022 License: MIT Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Changelog

type Changelog interface {
	Changelog(version.Version) (string, error)
}

Changelog is an interface to retrieve changelog description

type Config

type Config struct {
	DependsOn    []string                 `yaml:"depends_on"` // DependsOn specify dag dependencies between sources
	Name         string                   // Name contains a source name
	Kind         string                   // Kind defines a source kind
	Prefix       string                   // Deprecated in favor of Transformers on 2021/01/3
	Postfix      string                   // Deprecated in favor of Transformers on 2021/01/3
	Transformers transformer.Transformers // Transformers defines the list of transformers to apply to a source Output
	Replaces     Replacers                // Deprecated in favor of Transformers on 2021/01/3
	Spec         interface{}
	Scm          map[string]interface{} // Deprecated field on version [x.y.z]
	SCMID        string                 `yaml:"scmID"` // SCMID references a uniq scm configuration
}

Config struct defines a source configuration

type Replacer

type Replacer struct {
	From string
	To   string
}

Replacer is struct used to feed strings.Replacer

type Replacers

type Replacers []Replacer

Replacers is an array of Replacer

func (Replacers) Unmarshal

func (replacers Replacers) Unmarshal() (result []string)

Unmarshal read a struct of Replacers then return a slice of string

type Source

type Source struct {
	Changelog string // Changelog hold the changelog description
	Result    string // Result store the source result after a source run. This variable can't be set by an updatecli configuration
	Output    string // Output contains the value retrieved from a source
	Config    Config // Config defines a source specifications
	Scm       *scm.ScmHandler
}

Source defines how a value is retrieved from a specific source

func (*Source) Run

func (s *Source) Run() (err error)

Run execute actions defined by the source configuration

func (*Source) Unmarshal

func (s *Source) Unmarshal() (sourcer Sourcer, changelog Changelog, err error)

Unmarshal decode a source spec and returned its typed content

type Sourcer

type Sourcer interface {
	Source(workingDir string) (string, error)
}

Sourcer source is an interface to handle source spec

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL