metadata

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map map[string]interface{}

Map stores the tags for the entity

type Metadata

type Metadata struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
	EntityType  string `json:"type"`
	Metadata    Map    `json:"metadata"`
}

Metadata stores entity Metadata. Serialized as "entity"

func New

func New(name string, entityType string, displayName string) *Metadata

New creates a new metadata section that "identifies" an entity

func (*Metadata) AddMetadata

func (m *Metadata) AddMetadata(key string, value interface{})

AddMetadata adds a generic metadata to the entity

func (*Metadata) AddTag

func (m *Metadata) AddTag(key string, value interface{})

AddTag adds a tag to the entity

func (*Metadata) EqualsTo

func (m *Metadata) EqualsTo(b *Metadata) bool

EqualsTo returns true when both metadata are equal.

func (*Metadata) GetMetadata

func (m *Metadata) GetMetadata(key string) interface{}

GetMetadata gets a specific metadata from the metadata section of an entity

func (*Metadata) GetTag

func (m *Metadata) GetTag(key string) interface{}

GetTag gets a specific tag from the metadata section of an entity

Jump to

Keyboard shortcuts

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