ansiblegalaxyutils

package
v0.448.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

README

ansiblegalaxyutils

Implementations to handle ansible galaxy.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckValidCollectionName

func CheckValidCollectionName(name string) error

func IsValidCollectionName

func IsValidCollectionName(name string) bool

func WriteGalaxyYaml

func WriteGalaxyYaml(ctx context.Context, outFile filesinterfaces.File, data *GalaxyYaml) error

func WriteGalaxyYamlFromCreateCollectionOptions

func WriteGalaxyYamlFromCreateCollectionOptions(ctx context.Context, outFile filesinterfaces.File, options *CreateCollectionFileStructureOptions) error

func WriteInitialCollectionReadme

func WriteInitialCollectionReadme(ctx context.Context, outFile filesinterfaces.File, name string, namespace string) error

func WriteInitialCollectionReadmeFromCreateCollectionOptions

func WriteInitialCollectionReadmeFromCreateCollectionOptions(ctx context.Context, outFile filesinterfaces.File, options *CreateCollectionFileStructureOptions) error

Types

type CreateCollectionFileStructureOptions

type CreateCollectionFileStructureOptions struct {
	// The namespace of the collection.
	//
	// This can be a company/brand/organization or product namespace under which all content lives.
	//
	// May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with underscores or numbers and cannot contain consecutive underscores.
	Namespace string

	// The name of the collection.
	//
	// Has the same character restrictions as namespace.
	Name string

	// The version of the collection.
	//
	// Must be compatible with semantic versioning.
	Version string

	// A list of the collection’s content authors.
	//
	// Can be just the name or in the format ‘Full Name <email> (url) @nicks:irc/im.site#channel’.
	Authors []string
}

Options to create a collection file structure

Bases on:

https://docs.ansible.com/ansible/latest/dev_guide/collections_galaxy_meta.html

func (*CreateCollectionFileStructureOptions) GetAuthors

func (c *CreateCollectionFileStructureOptions) GetAuthors() ([]string, error)

func (*CreateCollectionFileStructureOptions) GetCreateFileOptions added in v0.423.0

func (*CreateCollectionFileStructureOptions) GetName

func (*CreateCollectionFileStructureOptions) GetNamespace

func (c *CreateCollectionFileStructureOptions) GetNamespace() (string, error)

func (*CreateCollectionFileStructureOptions) GetVersion

func (*CreateCollectionFileStructureOptions) GetVersionAsString

func (c *CreateCollectionFileStructureOptions) GetVersionAsString() (string, error)

type GalaxyYaml

type GalaxyYaml struct {
	Namespace string   `yaml:"namespace"`
	Name      string   `yaml:"name"`
	Version   string   `yaml:"version"`
	Readme    string   `yaml:"readme"`
	Authors   []string `yaml:"authors"`
}

Jump to

Keyboard shortcuts

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