Documentation
¶
Index ¶
- Constants
- Variables
- type Alias
- type Blank
- type CommentLine
- type Custom
- type Default
- type Dot
- type EqualSpecificityMatchError
- type FileParsingError
- type InvalidAliasSplitError
- type InvalidImportSplitError
- type LocalModule
- type NewLine
- type NoMatchingSectionForImportError
- type Section
- type SectionList
- type SectionParsingError
- type Standard
Constants ¶
View Source
const AliasType = "alias"
View Source
const BlankType = "blank"
View Source
const CustomSeparator = ","
CustomSeparator allows you to group multiple custom prefix together in the same section gci diff -s standard -s default -s prefix(github.com/company,gitlab.com/company,companysuffix)
View Source
const CustomType = "custom"
View Source
const DefaultType = "default"
View Source
const DotType = "dot"
View Source
const LocalModuleType = "localmodule"
View Source
const StandardType = "standard"
Variables ¶
View Source
var ( MissingImportStatementError = FileParsingError{errors.New("no import statement present in File")} ImportStatementNotClosedError = FileParsingError{errors.New("import statement not closed")} )
View Source
var MissingParameterClosingBracketsError = fmt.Errorf("section parameter is missing closing %q", utils.RightParenthesis)
View Source
var MoreThanOneOpeningQuotesError = fmt.Errorf("found more than one %q parameter start sequences", utils.RightParenthesis)
View Source
var SectionTypeDoesNotAcceptParametersError = errors.New("section type does not accept a parameter")
View Source
var SectionTypeDoesNotAcceptPrefixError = errors.New("section may not contain a Prefix")
View Source
var SectionTypeDoesNotAcceptSuffixError = errors.New("section may not contain a Suffix")
Functions ¶
This section is empty.
Types ¶
type Alias ¶
type Alias struct{}
func (Alias) MatchSpecificity ¶
func (b Alias) MatchSpecificity(spec *parse.GciImports) specificity.MatchSpecificity
type Blank ¶
type Blank struct{}
func (Blank) MatchSpecificity ¶
func (b Blank) MatchSpecificity(spec *parse.GciImports) specificity.MatchSpecificity
type CommentLine ¶
type CommentLine struct {
Comment string
}
func (CommentLine) MatchSpecificity ¶
func (c CommentLine) MatchSpecificity(spec *parse.GciImports) specificity.MatchSpecificity
func (CommentLine) String ¶
func (c CommentLine) String() string
func (CommentLine) Type ¶
func (c CommentLine) Type() string
type Custom ¶
type Custom struct {
Prefix string
}
func (Custom) MatchSpecificity ¶
func (c Custom) MatchSpecificity(spec *parse.GciImports) specificity.MatchSpecificity
type Default ¶
type Default struct{}
func (Default) MatchSpecificity ¶
func (d Default) MatchSpecificity(spec *parse.GciImports) specificity.MatchSpecificity
type Dot ¶
type Dot struct{}
func (Dot) MatchSpecificity ¶
func (d Dot) MatchSpecificity(spec *parse.GciImports) specificity.MatchSpecificity
type EqualSpecificityMatchError ¶
type EqualSpecificityMatchError struct { Imports *parse.GciImports SectionA, SectionB Section }
func (EqualSpecificityMatchError) Error ¶
func (e EqualSpecificityMatchError) Error() string
func (EqualSpecificityMatchError) Is ¶
func (e EqualSpecificityMatchError) Is(err error) bool
type FileParsingError ¶
type FileParsingError struct {
// contains filtered or unexported fields
}
func (FileParsingError) Is ¶
func (f FileParsingError) Is(err error) bool
func (FileParsingError) Unwrap ¶
func (f FileParsingError) Unwrap() error
type InvalidAliasSplitError ¶
type InvalidAliasSplitError struct {
// contains filtered or unexported fields
}
func (InvalidAliasSplitError) Error ¶
func (i InvalidAliasSplitError) Error() string
func (InvalidAliasSplitError) Is ¶
func (i InvalidAliasSplitError) Is(err error) bool
type InvalidImportSplitError ¶
type InvalidImportSplitError struct {
// contains filtered or unexported fields
}
func (InvalidImportSplitError) Error ¶
func (i InvalidImportSplitError) Error() string
func (InvalidImportSplitError) Is ¶
func (i InvalidImportSplitError) Is(err error) bool
type LocalModule ¶
type LocalModule struct {
Paths []string
}
func (*LocalModule) Configure ¶
func (m *LocalModule) Configure() error
Configure configures the module section by finding the module for the current path
func (*LocalModule) MatchSpecificity ¶
func (m *LocalModule) MatchSpecificity(spec *parse.GciImports) specificity.MatchSpecificity
func (*LocalModule) String ¶
func (m *LocalModule) String() string
func (*LocalModule) Type ¶
func (m *LocalModule) Type() string
type NewLine ¶
type NewLine struct{}
func (NewLine) MatchSpecificity ¶
func (n NewLine) MatchSpecificity(spec *parse.GciImports) specificity.MatchSpecificity
type NoMatchingSectionForImportError ¶
type NoMatchingSectionForImportError struct {
Imports *parse.GciImports
}
func (NoMatchingSectionForImportError) Error ¶
func (n NoMatchingSectionForImportError) Error() string
func (NoMatchingSectionForImportError) Is ¶
func (n NoMatchingSectionForImportError) Is(err error) bool
type Section ¶
type Section interface { // MatchSpecificity returns how well an Import matches to this Section MatchSpecificity(spec *parse.GciImports) specificity.MatchSpecificity // String Implements the stringer interface String() string // return section type Type() string }
Section defines a part of the formatted output.
type SectionList ¶
type SectionList []Section
func DefaultSectionSeparators ¶
func DefaultSectionSeparators() SectionList
func DefaultSections ¶
func DefaultSections() SectionList
func Parse ¶
func Parse(data []string) (SectionList, error)
func (SectionList) String ¶
func (list SectionList) String() []string
type SectionParsingError ¶
type SectionParsingError struct {
// contains filtered or unexported fields
}
func (SectionParsingError) Is ¶
func (s SectionParsingError) Is(err error) bool
func (SectionParsingError) Unwrap ¶
func (s SectionParsingError) Unwrap() error
func (SectionParsingError) Wrap ¶
func (s SectionParsingError) Wrap(sectionStr string) error
type Standard ¶
type Standard struct{}
func (Standard) MatchSpecificity ¶
func (s Standard) MatchSpecificity(spec *parse.GciImports) specificity.MatchSpecificity
Click to show internal directories.
Click to hide internal directories.