Documentation
¶
Index ¶
- Constants
- func ConvertAdapterStatus(resourceType, resourceID string, req *openapi.AdapterStatusCreateRequest) (*api.AdapterStatus, error)
- func ConvertCluster(req *openapi.ClusterCreateRequest, createdBy string) (*api.Cluster, error)
- func ConvertNodePool(req *openapi.NodePoolCreateRequest, ownerID, createdBy string) (*api.NodePool, error)
- func LoadDiscoveredKinds(i interface{}) string
- func LoadDiscoveredPaths(i interface{}) string
- func ObjectKind(i interface{}) *string
- func ObjectPath(id string, obj interface{}) *string
- func PresentAdapterStatus(adapterStatus *api.AdapterStatus) (openapi.AdapterStatus, error)
- func PresentCluster(cluster *api.Cluster) (openapi.Cluster, error)
- func PresentError(err *errors.ServiceError, instance string, traceID string) openapi.Error
- func PresentNodePool(nodePool *api.NodePool) (openapi.NodePool, error)
- func PresentReference(id, obj interface{}) openapi.ObjectReference
- func PresentTime(t time.Time) *time.Time
- func RegisterKind(objType interface{}, kindValue string)
- func RegisterPath(objType interface{}, pathValue string)
- type KindMappingFunc
- type PathMappingFunc
- type ProjectionList
Constants ¶
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 ¶
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 PresentAdapterStatus ¶
func PresentAdapterStatus(adapterStatus *api.AdapterStatus) (openapi.AdapterStatus, error)
PresentAdapterStatus converts api.AdapterStatus (GORM model) to openapi.AdapterStatus
func PresentCluster ¶
PresentCluster converts api.Cluster (GORM model) to openapi.Cluster
func PresentError ¶
PresentError converts a ServiceError to RFC 9457 Problem Details format
func PresentNodePool ¶
PresentNodePool converts api.NodePool (GORM model) to openapi.NodePool
func PresentReference ¶
func PresentReference(id, obj interface{}) openapi.ObjectReference
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