Documentation ¶
Overview ¶
tokens.go - Defines a TokenReader Interface as well as the types of internally implemented token readers
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONTokenReader ¶
type JSONTokenReader struct {
Tokens []string
}
func (*JSONTokenReader) Fetch ¶
func (jsonRetriever *JSONTokenReader) Fetch(fileName string) error
func (*JSONTokenReader) ToTokens ¶
func (jsonRetriever *JSONTokenReader) ToTokens() []string
type NgComponent ¶
type NgComponent struct { Selector string `json:"selector"` ClassName string `json:"className"` ModuleName string `json:"moduleName"` }
Struct that defines common Angular object types.
type NgTokenReader ¶
type NgTokenReader struct {
Components []NgComponent
}
Struct that holds Angular tokens.
Implements the TokenReader interface.
func (*NgTokenReader) Fetch ¶
func (ngCompReader *NgTokenReader) Fetch(fileName string) error
Retrieves a slice of NgComponent from a JSON file.
func (*NgTokenReader) ToTokens ¶
func (ngCompReader *NgTokenReader) ToTokens() []string
Turns the slice of NgComponents contained by the reader and turns them to a slice of strings
type TokenReader ¶
Interface defining how to retrieve tokens for searching
func CreateTokenReader ¶
func CreateTokenReader(tokenReaderType TokenReaderType) (TokenReader, error)
Returns a token reader based on the TokenReaderType
type TokenReaderType ¶
type TokenReaderType int
Defined type for TokenReaders
const ( NGTokenReaderType TokenReaderType = iota JSONTokenReaderType TokenReaderType = iota )
Currently implement TokenReader types
Click to show internal directories.
Click to hide internal directories.