Documentation
¶
Index ¶
- Constants
- func ConvertAdapterStatus(resourceType, resourceID string, req *openapi.AdapterStatusCreateRequest) (*api.AdapterStatus, error)
- func ConvertCluster(req *openapi.ClusterCreateRequest) (*api.Cluster, error)
- func ConvertNodePool(req *openapi.NodePoolCreateRequest, ownerID string) (*api.NodePool, error)
- func ConvertResource(req *openapi.ResourceCreateRequest) (*api.Resource, error)
- func ConvertResourceWithOwner(req *openapi.ResourceCreateRequest, ownerID, ownerKind, ownerHref string) (*api.Resource, 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 PresentResource(r *api.Resource) openapi.Resource
- func PresentResourceList(resources api.ResourceList, paging *api.PagingMeta) openapi.ResourceList
- 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 ¶
func ConvertCluster(req *openapi.ClusterCreateRequest) (*api.Cluster, error)
ConvertCluster converts openapi.ClusterCreateRequest to api.Cluster (GORM model)
func ConvertNodePool ¶
ConvertNodePool converts openapi.NodePoolCreateRequest to api.NodePool (GORM model)
func ConvertResource ¶ added in v0.3.0
func ConvertResource(req *openapi.ResourceCreateRequest) (*api.Resource, error)
ConvertResource converts an openapi.ResourceCreateRequest to an api.Resource GORM model. CreatedBy/UpdatedBy are set by the service layer from auth context.
func ConvertResourceWithOwner ¶ added in v0.3.0
func ConvertResourceWithOwner( req *openapi.ResourceCreateRequest, ownerID, ownerKind, ownerHref string, ) (*api.Resource, error)
ConvertResourceWithOwner converts a request to a child resource with owner references set.
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 PresentResource ¶ added in v0.3.0
PresentResource converts an api.Resource GORM model to an openapi.Resource.
func PresentResourceList ¶ added in v0.3.0
func PresentResourceList(resources api.ResourceList, paging *api.PagingMeta) openapi.ResourceList
PresentResourceList converts a slice of resources and paging metadata to an openapi.ResourceList.
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"`
Items []map[string]interface{} `json:"items"`
Page int32 `json:"page"`
Size int32 `json:"size"`
Total int32 `json:"total"`
}
func SliceFilter ¶
func SliceFilter(fields2Store []string, model interface{}) (*ProjectionList, *errors.ServiceError)
SliceFilter returns a projected list containing requested fields from each item