entity

package
v0.0.393 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

This package allows parsing entities from CUE fields with parsers that depend on the provided URL. Supported entity parsers need to be provided in advance.

Used for "integration" and "build" parsing.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DispatchingEntityParser

type DispatchingEntityParser struct {
	// contains filtered or unexported fields
}

func NewDispatchingEntityParser

func NewDispatchingEntityParser(urlCueKey string, parsers []EntityParser) *DispatchingEntityParser

Calls one of the registered entityt parsers, repending on the value of the "urlCueKey" field.

func (*DispatchingEntityParser) ParseEntity

type EntityParser

type EntityParser interface {
	// For example, "namespace.so/from-dockerfile"
	Url() string

	// Shortcut for "kind", for example, "docker"
	Shortcut() string

	// "v" is nil if the user used the shortest syntactic form. Example: `integration: "golang"`
	Parse(ctx context.Context, env *schema.Environment, pl parsing.EarlyPackageLoader, loc pkggraph.Location, v *fncue.CueV) (proto.Message, error)
}

type ParsedEntity

type ParsedEntity struct {
	Url  string
	Data proto.Message
}

Jump to

Keyboard shortcuts

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