entities

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package entities contains helper functions to convert to and from validate and print the Entity protobuf enum

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EntityTypeFromDB

func EntityTypeFromDB(entity db.Entities) pb.Entity

EntityTypeFromDB returns the entity type from the database entity

func EntityTypeToDB

func EntityTypeToDB(entity pb.Entity) db.Entities

EntityTypeToDB returns the database entity from the protobuf entity type

func FromString

func FromString(entity string) pb.Entity

FromString returns the Entity enum from a string. Typically used in CLI when constructing a protobuf message

func IsValidEntity

func IsValidEntity(entity pb.Entity) bool

IsValidEntity returns true if the entity type is valid

func KnownTypesCSV

func KnownTypesCSV() string

KnownTypesCSV returns a comma separated list of known entity types. Useful for UI

Types

type EntityType

type EntityType string

EntityType is the type of entity

const (
	// RepositoryEntity is a repository entity
	RepositoryEntity EntityType = "repository"
	// BuildEnvironmentEntity is a build environment entity
	BuildEnvironmentEntity EntityType = "build_environment"
	// ArtifactEntity is an artifact entity
	ArtifactEntity EntityType = "artifact"
	// PullRequestEntity is a pull request entity
	PullRequestEntity EntityType = "pull_request"
	// UnknownEntity is an explicitly unknown entity
	UnknownEntity EntityType = "unknown"
)

Entity types as string-like enums. Used in CLI and other user-facing code

func (EntityType) String

func (e EntityType) String() string

String returns the string representation of the entity type

Jump to

Keyboard shortcuts

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