Documentation ¶
Overview ¶
Package manifest handles loading and writing of the C3PM manifest file (usually c3pm.yml). It also stores the various types supported by the manifest, as well as utility functions to use them.
Index ¶
Constants ¶
const ( // Executable is the Type of a project yielding a binary executable. Executable = Type("executable") // Library is the Type of a project yielding a package to be included by others. Library = Type("library") )
const ( // C3PMVersion1 is the most recent manifest version. C3PMVersion1 = C3PMVersion(1) )
Variables ¶
var ErrParseC3PMVersion = errors.New("Could not parse C3PM version")
ErrParseC3PMVersion is returned when not able to parse the C3PM version to use.
var ErrParseDependencies = errors.New("Could not parse dependencies")
ErrParseDependencies is returned when an error occured while reading dependencies.
Functions ¶
This section is empty.
Types ¶
type AdapterConfig ¶ added in v0.1.0
type BuildConfig ¶ added in v0.1.0
type BuildConfig struct { Adapter *AdapterConfig `yaml:"adapter,omitempty"` Config interface{} `yaml:"config,omitempty"` }
type C3PMVersion ¶ added in v0.1.0
type C3PMVersion uint32
C3PMVersion holds the version of the c3pm manifest to use.
func C3PMVersionFromString ¶ added in v0.1.0
func C3PMVersionFromString(version string) (C3PMVersion, error)
C3PMVersionFromString returns the C3PMVersion corresponding to a given string.
func (C3PMVersion) MarshalYAML ¶ added in v0.1.0
func (v C3PMVersion) MarshalYAML() (interface{}, error)
MarshalYAML is used to write the version as YAML.
func (C3PMVersion) String ¶ added in v0.1.0
func (v C3PMVersion) String() string
String is used to return the stringified representation of the version.
func (*C3PMVersion) UnmarshalYAML ¶ added in v0.1.0
func (v *C3PMVersion) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML is used to read the version from the manifest YAML file.
type CustomCMake ¶ added in v0.1.0
type CustomCMake struct { Path string `yaml:"path"` Variables map[string]string `yaml:"variables"` Targets []string `yaml:"targets"` }
CustomCMake is used in cases where a project needs a complex custom CMake system.
type Dependencies ¶
Dependencies holds the list of the dependencies of a project.
func DependenciesFromMap ¶
func DependenciesFromMap(dependencies map[string]string) (Dependencies, error)
TODO: Unused
func (Dependencies) Append ¶ added in v0.3.0
func (d Dependencies) Append(d2 Dependencies) Dependencies
func (Dependencies) MarshalYAML ¶
func (d Dependencies) MarshalYAML() (interface{}, error)
MarshalYAML is used to write dependencies as YAML.
func (Dependencies) String ¶ added in v0.2.0
func (d Dependencies) String() string
type Manifest ¶
type Manifest struct { C3PMVersion C3PMVersion `yaml:"c3pm_version"` Type Type `yaml:"type"` Name string `yaml:"name"` Description string `yaml:"description"` Version Version `yaml:"version"` Publish *PublishConfig `yaml:"publish,omitempty"` Build *BuildConfig `yaml:"build,omitempty"` Documentation string `yaml:"documentation"` Website string `yaml:"website"` Repository string `yaml:"repository"` Contributors string `yaml:"contributors"` Standard string `yaml:"standard"` License string `yaml:"license"` Dependencies Dependencies `yaml:"dependencies"` TestDependencies Dependencies `yaml:"test_dependencies"` Tags []string `yaml:"tags,omitempty"` }
Manifest is the main configuration structure for C3PM.
func Load ¶
Load reads the file located at the given path, and stores its contents in a new Manifest struct.
type PublishConfig ¶ added in v0.1.0
type Type ¶
type Type string
Type holds the kind of project to manage.
func TypeFromString ¶
TypeFromString creates a Type instance from a corresponding string.
func (*Type) WriteAnswer ¶
WriteAnswer allows type to be used in survey questions
type Version ¶
type Version struct {
*semver.Version
}
Version holds the Semantic Versioning-compatible version of a package.
func VersionFromString ¶
VersionFromString converts a string to a Version instance.
func (Version) MarshalYAML ¶
MarshalYAML is used to write a Version to a YAML file.
func (*Version) UnmarshalYAML ¶
UnmarshalYAML is used to read a Version from a YAML file.
func (*Version) WriteAnswer ¶
WriteAnswer allows type to be used in survey questions