gitignoreio

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides methods for interacting with gitignore.io

func NewClient

func NewClient(noUpdate bool) *Client

NewClient creates and returns a new Client instance with the option to disable template updates using the noUpdate flag.

func (*Client) GetTemplate

func (c *Client) GetTemplate(key string) (*TemplateInfo, error)

GetTemplate retrieves a template by its key from the internal cache. If templates are not loaded, it initialises them first.

func (*Client) ListTemplates

func (c *Client) ListTemplates() ([]string, error)

ListTemplates retrieves the list of available template names from gitignore.io. Returns the sorted template names or an error.

func (*Client) UpdateTemplates added in v0.1.1

func (c *Client) UpdateTemplates() error

UpdateTemplates retrieves the list of available template names from gitignore.io and updates the internal cache.

type TemplateInfo

type TemplateInfo struct {
	Key      string `json:"key"`
	Name     string `json:"name"`
	Contents string `json:"contents"`
	FileName string `json:"fileName"`
}

TemplateInfo represents a template entry from gitignore.io

Jump to

Keyboard shortcuts

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