facts

package
v0.0.0-...-7ef1c60 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

facts provides a way to represent determisitic facts about the code in a simple key value store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Name string
	Fact Fact
}

Entry is a struct that represents a fact entry.

func (Entry) String

func (e Entry) String() string

type Fact

type Fact uint8
const (

	// None is the default value for Fact.
	// Getting a Fact of type None means there are no facts for the given key.
	None Fact = 0

	// GrpcServerType is a Fact that represents a gRPC server implementation object type.
	GrpcServerType Fact = 1

	// GrpcServerStream is a Fact that represents a gRPC server stream object.
	GrpcServerStream Fact = 2
)

func (Fact) String

func (f Fact) String() string

String returns a string representation of the Fact.

type Keeper

type Keeper map[string]Fact

Keeper is a map of facts.

func NewKeeper

func NewKeeper() Keeper

NewKeeper creates and initializes a new Keeper.

func (Keeper) AddFact

func (fm Keeper) AddFact(entry Entry) error

AddFact adds a new fact to the Keeper.

func (Keeper) GetFact

func (fm Keeper) GetFact(name string) Fact

GetFact returns a fact from the Keeper. If the fact does not exist, it returns None.

Jump to

Keyboard shortcuts

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