querying

package
v0.0.0-...-eb336c4 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFullEnv

func GetFullEnv(data *storage.Data, project, envQ string) (string, bool)

func GetFullService

func GetFullService(
	data *storage.Data,
	project, environment, serviceQ string,
) (string, bool)

func InitQueryService

func InitQueryService(data *storage.Data)

func PlaceQuery

func PlaceQuery(
	qr porter.QueryRequest,
	data *storage.Data,
	queueChan chan QueryJob,
)

func ProcessOneValue

func ProcessOneValue(
	value []byte,
	requestedFields []string,
	userRegex *regexp.Regexp,
	regexQ string,
	regexQField string,
	negateUserRegex bool,
	isSimpleQuery bool,
) (map[string]interface{}, bool, error)

func Queue

func Queue(data *storage.Data, queueChan chan QueryJob)

func SetMsgInCache

func SetMsgInCache(
	data *storage.Data,
	requestId string,
	status porter.QStatus,
	msg string,
)

func SetResultInCache

func SetResultInCache(
	data *storage.Data,
	requestId string,
	msg string,
	result []map[string]interface{},
)

func Subscriber

func Subscriber(data *storage.Data, reqs chan<- porter.QueryRequest)

func TimeQueryBeaconToSeek

func TimeQueryBeaconToSeek(timeQuery string) string

func Worker

func Worker(data *storage.Data, workerChan chan QueryJob)

Worker should either set "timeout", "error", "none" or processed json data as a value for job.ID key.

Types

type QueryJob

type QueryJob struct {
	ID              string
	IsSimpleQuery   bool
	Beacon          string
	ValidPrefix     string
	NorthStar       string
	FieldsQ         string
	RegexQ          string
	RegexQField     string
	NegateUserRegex bool
}

type RequestQuery

type RequestQuery struct {
	ProjectName string
	Env         string
	Service     string
	Date        string
	TimeQuery   string
}

func (RequestQuery) BeaconToSeek

func (rq RequestQuery) BeaconToSeek(syntax timeSyntax, now time.Time) (string, error)

func (RequestQuery) NorthStar

func (rq RequestQuery) NorthStar(
	syntax timeSyntax,
	now time.Time,
) (string, error)

func (RequestQuery) ValidPrefix

func (rq RequestQuery) ValidPrefix(syntax timeSyntax) string

Jump to

Keyboard shortcuts

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