presenters

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BasePath = "/api/rh-trex/v1"
)

Variables

This section is empty.

Functions

func ConvertDinosaur

func ConvertDinosaur(dinosaur openapi.Dinosaur) *api.Dinosaur

func ObjectKind

func ObjectKind(i interface{}) *string

func ObjectPath

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

func PresentDinosaur

func PresentDinosaur(dinosaur *api.Dinosaur) openapi.Dinosaur

func PresentError

func PresentError(err *errors.ServiceError) openapi.Error

func PresentReference

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

func PresentTime

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

Types

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