metadata

package
v0.0.0-...-e30ce0b Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RawPayloadKey = "rawPayload"

	ContentType = "contentType"
)

Variables

This section is empty.

Functions

func DecodeMetadata

func DecodeMetadata(input any, result any) error

func GetMetadataInfoFromStructType

func GetMetadataInfoFromStructType(t reflect.Type, metadataMap *MetadataMap, componentType ComponentType) error

GetMetadataInfoFromStructType converts a struct to a map of field name (or struct tag) to field type. This is used to generate metadata documentation for components.

func IsRawPayload

func IsRawPayload(props map[string]string) (bool, error)

func TryGetContentType

func TryGetContentType(props map[string]string) (string, bool)

Types

type Base

type Base struct {
	Name       string
	Properties map[string]string `json:"properties,omitempty"`
}

type ByteSize

type ByteSize struct {
	resource.Quantity
}

func NewByteSize

func NewByteSize(defaultValue int64) ByteSize

NewByteSize returns a new ByteSize with a default value in bytes.

func (*ByteSize) GetBytes

func (q *ByteSize) GetBytes() (int64, error)

GetBytes returns the number of bytes in the quantity. Note: this operation is expensive, so it's recommended to cache the returned value.

type ComponentType

type ComponentType string
const (
	BindingType            ComponentType = "bindings"
	StateStoreType         ComponentType = "state"
	SecretStoreType        ComponentType = "secretstores"
	PubSubType             ComponentType = "pubsub"
	LockStoreType          ComponentType = "lock"
	ConfigurationStoreType ComponentType = "configuration"
	MiddlewareType         ComponentType = "middleware"
	CryptoType             ComponentType = "crypto"
	NameResolutionType     ComponentType = "nameresolution"
	WorkflowType           ComponentType = "workflows"
)

func (ComponentType) BuiltInMetadataProperties

func (t ComponentType) BuiltInMetadataProperties() []string

BuiltInMetadataProperties returns the built-in metadata properties for the given component type. These are normally parsed by the runtime.

func (ComponentType) IsValid

func (t ComponentType) IsValid() bool

IsValid returns true if the component type is valid.

type Duration

type Duration struct {
	time.Duration
}

func (*Duration) MarshalJSON

func (d *Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

type MetadataField

type MetadataField struct {
	// Field type
	Type string
	// True if the field should be ignored by the metadata analyzer
	Ignored bool
	// True if the field is deprecated
	Deprecated bool
	// Aliases used for old, deprecated names
	Aliases []string
}

type MetadataMap

type MetadataMap map[string]MetadataField

Jump to

Keyboard shortcuts

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