internal

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultGitRepo string = "https://github.com/github/gitignore.git"

DefaultGitRepo is the default repository to use for gitignore files.

View Source
const VERSION = "UNKNOWN"

VERSION is the app-global version string which is populated with a real value during the build process.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	// List returns the list of options that can be used to generate a
	// gitignore file.
	List() ([]string, error)

	// Generate creates a gitignore file with the given options.
	Generate(options []string) (string, error)

	// Update updates this plugin's local data.
	Update() error
}

Adapter is any adapter that the git-ignore client can use to retrieve content for generating a gitignore file.

type Client

type Client struct {
	Adapters []Adapter
}

Client is an object used to interact with the gitignore provider. It knows how to retrieve a list of supported apps to be ignored and turn them into a gitignore file.

func NewClient

func NewClient() (*Client, error)

NewClient creates a new client for generating gitignore files.

func (*Client) Generate

func (client *Client) Generate(options []string) (string, error)

Generate generates a .gitignore file that excludes files based on the given options.

func (*Client) List

func (client *Client) List() ([]string, error)

List returns a list of valid options for generating a gitignore file. Each of these options maps to a service or application that generates file that should be excluded from a git repository.

func (*Client) Update

func (client *Client) Update() error

Update updates all local cache adapters.

type GitAdapter

type GitAdapter struct {
	RepoDirectory string
	RepoURL       string
}

GitAdapter is an adapter for pulling gitignore data from a git repository.

func NewGitAdapter

func NewGitAdapter() (*GitAdapter, error)

NewGitAdapter creates a new adapter for working with Git repositories.

func (*GitAdapter) Generate

func (adapter *GitAdapter) Generate(options []string) (string, error)

Generate creates a gitignore file with the given options.

func (*GitAdapter) List

func (adapter *GitAdapter) List() ([]string, error)

List returns the list of options that can be used to generate a gitignore file.

func (*GitAdapter) Update

func (adapter *GitAdapter) Update() error

Update updates this plugin's local data.

Jump to

Keyboard shortcuts

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