presenters

package
v0.0.0-...-145cf54 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BasePath = "/api/hyperfleet/v1"
)

Variables

This section is empty.

Functions

func ConvertAdapterStatus

func ConvertAdapterStatus(
	resourceType, resourceID string,
	req *openapi.AdapterStatusCreateRequest,
) (*api.AdapterStatus, error)

ConvertAdapterStatus converts openapi.AdapterStatusCreateRequest to api.AdapterStatus (GORM model)

func ConvertCluster

func ConvertCluster(req *openapi.ClusterCreateRequest, createdBy string) (*api.Cluster, error)

ConvertCluster converts openapi.ClusterCreateRequest to api.Cluster (GORM model)

func ConvertNodePool

func ConvertNodePool(req *openapi.NodePoolCreateRequest, ownerID, createdBy string) (*api.NodePool, error)

ConvertNodePool converts openapi.NodePoolCreateRequest to api.NodePool (GORM model)

func LoadDiscoveredKinds

func LoadDiscoveredKinds(i interface{}) string

func LoadDiscoveredPaths

func LoadDiscoveredPaths(i interface{}) string

func ObjectKind

func ObjectKind(i interface{}) *string

func ObjectPath

func ObjectPath(id string, obj interface{}) *string

func PresentAdapterStatus

func PresentAdapterStatus(adapterStatus *api.AdapterStatus) (openapi.AdapterStatus, error)

PresentAdapterStatus converts api.AdapterStatus (GORM model) to openapi.AdapterStatus

func PresentCluster

func PresentCluster(cluster *api.Cluster) (openapi.Cluster, error)

PresentCluster converts api.Cluster (GORM model) to openapi.Cluster

func PresentError

func PresentError(err *errors.ServiceError, instance string, traceID string) openapi.Error

PresentError converts a ServiceError to RFC 9457 Problem Details format

func PresentNodePool

func PresentNodePool(nodePool *api.NodePool) (openapi.NodePool, error)

PresentNodePool converts api.NodePool (GORM model) to openapi.NodePool

func PresentReference

func PresentReference(id, obj interface{}) openapi.ObjectReference

func PresentTime

func PresentTime(t time.Time) *time.Time

func RegisterKind

func RegisterKind(objType interface{}, kindValue string)

func RegisterPath

func RegisterPath(objType interface{}, pathValue string)

Types

type KindMappingFunc

type KindMappingFunc func(interface{}) string

type PathMappingFunc

type PathMappingFunc func(interface{}) string

type ProjectionList

type ProjectionList struct {
	Kind  string                   `json:"kind"`
	Page  int32                    `json:"page"`
	Size  int32                    `json:"size"`
	Total int32                    `json:"total"`
	Items []map[string]interface{} `json:"items"`
}

func SliceFilter

func SliceFilter(fields2Store []string, model interface{}) (*ProjectionList, *errors.ServiceError)
SliceFilter

Convert slice of structures to a []byte stream. Non-existing fields will cause a validation error

@param fields2Store []string - list of fields to export (from `json` tag)

@param items []interface{} - slice of structures to export

@param kind, page, size, total - from openapi.SubscriptionList et al.

@return []byte

Jump to

Keyboard shortcuts

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