Documentation
¶
Index ¶
- Constants
- Variables
- func CheckAttributes(ctx context.Context, gitRepo *git.Repository, treeish string, ...) (map[string]*Attributes, error)
- type Attribute
- type Attributes
- func (attrs *Attributes) Get(name string) Attribute
- func (attrs *Attributes) GetDetectable() optional.Option[bool]
- func (attrs *Attributes) GetDocumentation() optional.Option[bool]
- func (attrs *Attributes) GetGenerated() optional.Option[bool]
- func (attrs *Attributes) GetGitlabLanguage() optional.Option[string]
- func (attrs *Attributes) GetLanguage() optional.Option[string]
- func (attrs *Attributes) GetLinguistLanguage() optional.Option[string]
- func (attrs *Attributes) GetVendored() optional.Option[bool]
- type BatchChecker
- type CheckAttributeOpts
Constants ¶
View Source
const ( LinguistVendored = "linguist-vendored" LinguistGenerated = "linguist-generated" LinguistDocumentation = "linguist-documentation" LinguistDetectable = "linguist-detectable" LinguistLanguage = "linguist-language" GitlabLanguage = "gitlab-language" Lockable = "lockable" Filter = "filter" )
Variables ¶
View Source
var LinguistAttributes = []string{ LinguistVendored, LinguistGenerated, LinguistDocumentation, LinguistDetectable, LinguistLanguage, GitlabLanguage, }
Functions ¶
func CheckAttributes ¶
func CheckAttributes(ctx context.Context, gitRepo *git.Repository, treeish string, opts CheckAttributeOpts) (map[string]*Attributes, error)
CheckAttributes return the attributes of the given filenames and attributes in the given treeish. If treeish is empty, then it will use current working directory, otherwise it will use the provided treeish on the bare repo
Types ¶
type Attribute ¶
type Attribute string
func (Attribute) IsUnspecified ¶
type Attributes ¶
type Attributes struct {
// contains filtered or unexported fields
}
func NewAttributes ¶
func NewAttributes() *Attributes
func (*Attributes) Get ¶
func (attrs *Attributes) Get(name string) Attribute
func (*Attributes) GetDetectable ¶
func (attrs *Attributes) GetDetectable() optional.Option[bool]
func (*Attributes) GetDocumentation ¶
func (attrs *Attributes) GetDocumentation() optional.Option[bool]
func (*Attributes) GetGenerated ¶
func (attrs *Attributes) GetGenerated() optional.Option[bool]
func (*Attributes) GetGitlabLanguage ¶
func (attrs *Attributes) GetGitlabLanguage() optional.Option[string]
func (*Attributes) GetLanguage ¶
func (attrs *Attributes) GetLanguage() optional.Option[string]
func (*Attributes) GetLinguistLanguage ¶
func (attrs *Attributes) GetLinguistLanguage() optional.Option[string]
func (*Attributes) GetVendored ¶
func (attrs *Attributes) GetVendored() optional.Option[bool]
type BatchChecker ¶
type BatchChecker struct {
// contains filtered or unexported fields
}
BatchChecker provides a reader for check-attribute content that can be long running
func NewBatchChecker ¶
func NewBatchChecker(repo *git.Repository, treeish string, attributes []string) (checker *BatchChecker, returnedErr error)
NewBatchChecker creates a check attribute reader for the current repository and provided commit ID If treeish is empty, then it will use current working directory, otherwise it will use the provided treeish on the bare repo
func (*BatchChecker) CheckPath ¶
func (c *BatchChecker) CheckPath(path string) (rs *Attributes, err error)
CheckPath check attr for given path
func (*BatchChecker) Close ¶
func (c *BatchChecker) Close() error
type CheckAttributeOpts ¶
Click to show internal directories.
Click to hide internal directories.