conf

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatTemplate added in v0.3.0

func FormatTemplate(path string) ([]string, error)

テンプレートを解析してPathを生成します

func GetTemplateFuncMap added in v0.6.0

func GetTemplateFuncMap() *template.FuncMap

Types

type Entry

type Entry struct {
	RepoPath p.Path
	HomePath p.Path
	Index    int //0からスタートする行数
	Option   *EntryOption
}

設定ファイルの1行に対応した構造体

func NewEntry

func NewEntry(repoPath, homePath p.Path) Entry

新しいEntryを生成します

func NewEntryWithIndex

func NewEntryWithIndex(repoPath, homePath p.Path, index int) Entry

Entryを行数付きで作成します

func (entry *Entry) CheckSymLink() error

リンクが正常に設定されているかチェックする

func (*Entry) ExistsRepoPath

func (entry *Entry) ExistsRepoPath() bool

repoPathが存在するかどうかを確認する

func (*Entry) Format added in v0.6.0

func (entry *Entry) Format() (*Entry, error)

EntryのPathを絶対パスを変換します

func (*Entry) FormatHome added in v0.3.0

func (entry *Entry) FormatHome() (p.Path, error)

HomePathの絶対パスを返します

func (*Entry) FormatRepo added in v0.3.0

func (entry *Entry) FormatRepo() (p.Path, error)

RepoPathの絶対パスを返します

func (entry *Entry) MakeSymLink() error

リンクを作成する

func (entry *Entry) RemoveSymLink() error

リンクを削除する

func (*Entry) String

func (item *Entry) String(replace bool) (string, error)

type EntryOption added in v0.4.0

type EntryOption struct {
	Template   bool
	CreateLink bool
}

func DefaultOption added in v0.4.0

func DefaultOption() *EntryOption

func ParseEntryOption added in v0.4.0

func ParseEntryOption(opt string) (*EntryOption, error)

type IgnoreList added in v0.3.2

type IgnoreList gi.GitIgnore

func ReadIgnoreList added in v0.3.2

func ReadIgnoreList() *IgnoreList

lico.ignoreを読み込んでIgnoreListを生成する

func (*IgnoreList) MatchEntry added in v0.3.2

func (i *IgnoreList) MatchEntry(e Entry) (bool, string)

entryがIgnoreListに含まれているかどうか

func (*IgnoreList) MatchString added in v0.3.2

func (i *IgnoreList) MatchString(s string) (bool, string)

パスがIgnoreListに含まれているかどうか

type List

type List []Entry

設定ファイル全体

func ReadConf

func ReadConf() (*List, error)

設定ファイルを読み込みます

func ReadCreatedList added in v0.3.0

func ReadCreatedList() (*List, error)

func (*List) GetItemFromPath

func (list *List) GetItemFromPath(path p.Path) (*Entry, error)

指定されたパスを持つEntryを返します

func (*List) HasHomeFile

func (entries *List) HasHomeFile(path p.Path) (bool, error)

パスがホームファイルに含まれているかどうか

func (*List) HasRepoFile

func (entries *List) HasRepoFile(path p.Path) (bool, error)

パスがリポジトリファイルに含まれているかどうか

Jump to

Keyboard shortcuts

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