helper

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package helper provides helper functions for mapping between domain models and API models.

Index

Constants

View Source
const (
	// TextJSON is the content type for JSON.
	TextJSON = "text/json"
	// TextYAML is the content type for YAML.
	TextYAML = "text/yaml"
	// Empty is the content type for empty.
	// Empty content type is treated as YAML by default.
	// Due to spec miss, old otel-collector sends empty content type even though it should be YAML.
	Empty = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mapper

type Mapper struct{}

Mapper is a struct that provides methods to map between domain models and API models.

func NewMapper

func NewMapper() *Mapper

NewMapper creates a new instance of Mapper.

func (*Mapper) MapAPIToAgent

func (mapper *Mapper) MapAPIToAgent(apiAgent *v1.Agent) *agentmodel.Agent

MapAPIToAgent maps an API model Agent to a domain model Agent.

func (*Mapper) MapAPIToAgentGroup

func (mapper *Mapper) MapAPIToAgentGroup(apiAgentGroup *v1.AgentGroup) *agentmodel.AgentGroup

MapAPIToAgentGroup maps an API model AgentGroup to a domain model AgentGroup.

func (*Mapper) MapAPIToAgentPackage added in v0.1.28

func (mapper *Mapper) MapAPIToAgentPackage(apiModel *v1.AgentPackage) *agentmodel.AgentPackage

MapAPIToAgentPackage maps an API model AgentPackage to a domain model AgentPackage.

func (*Mapper) MapAPIToAgentRemoteConfig added in v0.1.35

func (mapper *Mapper) MapAPIToAgentRemoteConfig(
	api *v1.AgentRemoteConfig,
) *agentmodel.AgentRemoteConfig

MapAPIToAgentRemoteConfig maps an API model AgentRemoteConfig to a domain model.

func (*Mapper) MapAPIToCertificate added in v0.1.28

func (mapper *Mapper) MapAPIToCertificate(api *v1.Certificate) *agentmodel.Certificate

MapAPIToCertificate maps an API model Certificate to a domain model Certificate.

func (*Mapper) MapAPIToNamespace added in v0.1.35

func (mapper *Mapper) MapAPIToNamespace(
	apiModel *v1.Namespace,
) *agentmodel.Namespace

MapAPIToNamespace maps an API Namespace to a domain Namespace.

func (*Mapper) MapAPIToRoleBinding added in v0.1.35

func (mapper *Mapper) MapAPIToRoleBinding(apiRB *v1.RoleBinding) *usermodel.RoleBinding

MapAPIToRoleBinding maps an API model RoleBinding to a domain model RoleBinding.

func (*Mapper) MapAgentGroupToAPI

func (mapper *Mapper) MapAgentGroupToAPI(domainAgentGroup *agentmodel.AgentGroup) *v1.AgentGroup

MapAgentGroupToAPI maps a domain model AgentGroup to an API model AgentGroup.

func (*Mapper) MapAgentPackageToAPI added in v0.1.28

func (mapper *Mapper) MapAgentPackageToAPI(agentPackage *agentmodel.AgentPackage) *v1.AgentPackage

MapAgentPackageToAPI maps a domain model AgentPackage to an API model AgentPackage.

func (*Mapper) MapAgentRemoteConfigToAPI added in v0.1.35

func (mapper *Mapper) MapAgentRemoteConfigToAPI(
	domain *agentmodel.AgentRemoteConfig,
) *v1.AgentRemoteConfig

MapAgentRemoteConfigToAPI maps a domain model AgentRemoteConfig to an API model.

func (*Mapper) MapAgentToAPI

func (mapper *Mapper) MapAgentToAPI(agent *agentmodel.Agent) *v1.Agent

MapAgentToAPI maps a domain model Agent to an API model Agent.

func (*Mapper) MapCertificateToAPI added in v0.1.28

func (mapper *Mapper) MapCertificateToAPI(domain *agentmodel.Certificate) *v1.Certificate

MapCertificateToAPI maps a domain model Certificate to an API model Certificate.

func (*Mapper) MapNamespaceToAPI added in v0.1.35

func (mapper *Mapper) MapNamespaceToAPI(
	namespace *agentmodel.Namespace,
) *v1.Namespace

MapNamespaceToAPI maps a domain Namespace to an API Namespace.

func (*Mapper) MapPermissionToAPI added in v0.1.35

func (mapper *Mapper) MapPermissionToAPI(domain *usermodel.Permission) *v1.Permission

MapPermissionToAPI maps a domain model Permission to an API model Permission.

func (*Mapper) MapRoleBindingToAPI added in v0.1.35

func (mapper *Mapper) MapRoleBindingToAPI(domain *usermodel.RoleBinding) *v1.RoleBinding

MapRoleBindingToAPI maps a domain model RoleBinding to an API model RoleBinding.

func (*Mapper) MapRoleToAPI added in v0.1.35

func (mapper *Mapper) MapRoleToAPI(domain *usermodel.Role) *v1.Role

MapRoleToAPI maps a domain model Role to an API model Role.

func (*Mapper) MapUserRoleToAPI added in v0.1.35

func (mapper *Mapper) MapUserRoleToAPI(domain *usermodel.UserRole) *v1.UserRole

MapUserRoleToAPI maps a domain model UserRole to an API model UserRole.

func (*Mapper) MapUserToAPI added in v0.1.35

func (mapper *Mapper) MapUserToAPI(domain *usermodel.User) *v1.User

MapUserToAPI maps a domain model User to an API model User.

Jump to

Keyboard shortcuts

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