common

package
v0.0.0-...-21597fb Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActualWindowLengthKey = SearchContextKey("actualWindowLengthKey")
	CommitToIdxKey        = SearchContextKey("commitToIdxKey")
	FirstCommitIDKey      = SearchContextKey("firstCommitIDKey")
	FirstTileIDKey        = SearchContextKey("firstTileIDKey")
	LastTileIDKey         = SearchContextKey("lastTileIDKey")
	QualifiedCLIDKey      = SearchContextKey("qualifiedCLIDKey")
	QualifiedPSIDKey      = SearchContextKey("qualifiedPSIDKey")
	QueryKey              = SearchContextKey("queryKey")
)

Variables

This section is empty.

Functions

func AddCommitsData

func AddCommitsData(ctx context.Context, db *pgxpool.Pool, windowLength int) (context.Context, error)

addCommitsData finds the current sliding window of data (The last N commits) and adds the derived data to the given context and returns it.

func GetActualWindowLength

func GetActualWindowLength(ctx context.Context) int

func GetCommitToIdxMap

func GetCommitToIdxMap(ctx context.Context) map[schema.CommitID]int

func GetFirstCommitID

func GetFirstCommitID(ctx context.Context) schema.CommitID

func GetFirstTileID

func GetFirstTileID(ctx context.Context) schema.TileID

func GetLastTileID

func GetLastTileID(ctx context.Context) schema.TileID

func GetQualifiedCL

func GetQualifiedCL(ctx context.Context) string

func GetQualifiedPS

func GetQualifiedPS(ctx context.Context) string

func GetQuery

func GetQuery(ctx context.Context) query.Search

func ToJSON

func ToJSON(obj interface{}) (string, error)

toJSON creates a json string from an object.

Types

type DigestWithTraceAndGrouping

type DigestWithTraceAndGrouping struct {
	TraceID    schema.TraceID
	GroupingID schema.GroupingID
	Digest     schema.DigestBytes
	// OptionsID will be set for CL data only; for primary data we have to look it up from a
	// different table and the options could change over time.
	OptionsID schema.OptionsID
}

type FilterSets

type FilterSets struct {
	Key    string
	Values []string
}

type GroupingDigestKey

type GroupingDigestKey struct {
	GroupingID schema.MD5Hash
	Digest     schema.MD5Hash
}

GroupingDigestKey provides a struct to use as a key combination of a grouping ID and a digest.

type SearchContextKey

type SearchContextKey string

To avoid piping a lot of info about the commits in the most recent window through all the functions in the search pipeline, we attach them as values to the context.

Jump to

Keyboard shortcuts

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