helper

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TypeLinkProtoType — domain.Type → protobuf.Type
	TypeLinkProtoType = linker.NewLinker[domain.Type, resource.Type](
		linker.Link(domain.Memory, resource.Type_Memory),
		linker.Link(domain.CPU, resource.Type_CPU),
	)

	// ProtoTypeLinkType — protobuf.Type → domain.Type
	ProtoTypeLinkType = linker.NewLinker[resource.Type, domain.Type](
		linker.Link(resource.Type_Memory, domain.Memory),
		linker.Link(resource.Type_CPU, domain.CPU),
	)

	// StateLinkProtoState — domain.State → protobuf.State
	StateLinkProtoState = linker.NewLinker[domain.State, resource.State](
		linker.Link(domain.Normal, resource.State_Normal),
		linker.Link(domain.Warning, resource.State_Warning),
		linker.Link(domain.Alarm, resource.State_Alarm),
	)

	// ProtoStateLinkState — protobuf.State → domain.State
	ProtoStateLinkState = linker.NewLinker[resource.State, domain.State](
		linker.Link(resource.State_Normal, domain.Normal),
		linker.Link(resource.State_Warning, domain.Warning),
		linker.Link(resource.State_Alarm, domain.Alarm),
	)
)

Functions

func NewFromProtoResource

func NewFromProtoResource(r *resource.Resource) (*domain.Resource, error)

NewFromProtoResource преобразует protobuf.Resource в domain.Resource.

func NewFromResource

func NewFromResource(r *domain.Resource) (*resource.Resource, error)

NewFromResource преобразует domain.Resource в protobuf.Resource.

Types

This section is empty.

Jump to

Keyboard shortcuts

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