tokens

package
v0.0.0-...-b203053 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

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

type TokenReader interface {
	Fetch(location string) error
	ToTokens() []string
}

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

Jump to

Keyboard shortcuts

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