presenters

package
v0.0.0-...-2369383 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func ConvertConsumer

func ConvertConsumer(consumer openapi.Consumer) *api.Consumer

func ObjectKind

func ObjectKind(i interface{}) *string

func ObjectPath

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

func PresentConsumer

func PresentConsumer(consumer *api.Consumer) openapi.Consumer

func PresentError

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

func PresentReference

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

func PresentResourceBundle

func PresentResourceBundle(resource *api.Resource) (*openapi.ResourceBundle, error)

PresentResourceBundle converts a resource from the API to the openapi representation.

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