Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoRepositories reflects an own error dedicated to the situation // that there are no repositories configured / defined. ErrNoRepositories = errors.New("No repositories defined/configured.") )
Functions ¶
func IsNoRepositories ¶
IsNoRepositories returns a boolean indicating whether the error is known to report that there are no repositories.
Types ¶
type JSONProvider ¶
type JSONProvider struct {
// contains filtered or unexported fields
}
JSONProvider provides the data structure for a configuration file that is defined in JSON
func NewJSONProvider ¶
func NewJSONProvider(c []byte) (*JSONProvider, error)
NewJSONProvider will create a new provider to work with JSON content c in a convenient way
func (*JSONProvider) Get ¶
func (p *JSONProvider) Get(key string) interface{}
Get returns key from the configuration and will not cast it
func (*JSONProvider) GetContentMap ¶
func (p *JSONProvider) GetContentMap() map[string]interface{}
GetContentMap returns the complete content of the provider data source as a map
func (*JSONProvider) GetString ¶
func (p *JSONProvider) GetString(key string) string
GetString returns key from the configuration as a casted String
func (*JSONProvider) GetStringSlice ¶
func (p *JSONProvider) GetStringSlice(key string) []string
GetStringSlice returns the value associated with the key as a slice of strings.
type Medusa ¶
type Medusa struct {
// contains filtered or unexported fields
}
Medusa reflects the original Medusa configuration file.
func NewMedusa ¶
NewMedusa will create a new medusa configuration object. If no configuration is given, an error will be returned.
func (*Medusa) GetNamesOfRepositories ¶
func (m *Medusa) GetNamesOfRepositories() ([]*dependency.Package, error)
GetNamesOfRepositories returns all Packages from the configuration key "repositories". A repository will only be returned when it is complete (means a name and an url exists)
func (*Medusa) GetRepositoryURLOfPackage ¶
GetRepositoryURLOfPackage will determine if package p is part of the configuration. If p is part and a url is configured and this url is valid, this url will be returned. Otherwise an error.
func (*Medusa) GetRequire ¶
GetRequire returns all the configuration key "require"
type Provider ¶
type Provider interface { // Get returns key from the configuration and will not cast it Get(key string) interface{} // GetString returns key from the configuration as a casted String GetString(key string) string // GetStringSlice returns the value associated with the key as a slice of strings. GetStringSlice(key string) []string // GetContentMap returns the complete content of the provider data source as a map GetContentMap() map[string]interface{} }
Provider represents a configuration provider. Valid provider that implement this interface
* ViperProvider (viper - https://github.com/spf13/viper) * JSONProvider
type Satis ¶
type Satis struct {
// contains filtered or unexported fields
}
Satis reflects the a Satis configuration file.
func NewSatis ¶
NewSatis will create a new satis configuration object. If no configuration is given, an error will be returned.
func (*Satis) AddRepositories ¶
AddRepositories will add a list of repositories u to the current satis configuration
func (*Satis) AddRepository ¶
AddRepository will add repository u to the current satis configuration
func (*Satis) GetRepositoriesAsSlice ¶
func (s *Satis) GetRepositoriesAsSlice() []SatisRepository
GetRepositoriesAsSlice returns all configured repositories from the configuration as a list.
type SatisRepository ¶
type SatisRepository struct { // Type is the repository type, like `git` or `svn` Type string `json:"type"` // URL is the URL of the repository that contains packages URL string `json:"url"` }
SatisRepository reflects a single repository entry in satis `repositories` section
type ViperProvider ¶
type ViperProvider struct {
// contains filtered or unexported fields
}
ViperProvider represents the structure to manage configurations based on github.com/spf13/viper
func NewViperProvider ¶
func NewViperProvider(v *viper.Viper) (*ViperProvider, error)
NewViperProvider creates a new configuration provider based on github.com/spf13/viper
func (*ViperProvider) Get ¶
func (p *ViperProvider) Get(key string) interface{}
Get returns key from the configuration and will not cast it
func (*ViperProvider) GetContentMap ¶
func (p *ViperProvider) GetContentMap() map[string]interface{}
GetContentMap returns the complete content of the provider data source as a map
func (*ViperProvider) GetString ¶
func (p *ViperProvider) GetString(key string) string
GetString returns key from the configuration as a casted String
func (*ViperProvider) GetStringSlice ¶
func (p *ViperProvider) GetStringSlice(key string) []string
GetStringSlice returns the value associated with the key as a slice of strings.