viewservice

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterListMockView = "clusterlistmock"
)
View Source
const (
	ClusterListView = "clusterlist"
)

Variables

View Source
var ErrViewNotRegistered = errors.New("view not registered")
View Source
var Generators = ViewGenerators{}

Functions

This section is empty.

Types

type ViewGenerator

type ViewGenerator interface {
	GenerateView(ctx context.Context, opts ...ViewGeneratorsOption) (apiview.View, error)
	GetMetadata() apiview.ViewMetadata
}

type ViewGenerators

type ViewGenerators map[string]ViewGenerator

func (*ViewGenerators) GetGenerator

func (lv *ViewGenerators) GetGenerator(listType string) (ViewGenerator, error)

func (*ViewGenerators) IsRegistered

func (lv *ViewGenerators) IsRegistered(listType string) bool

func (*ViewGenerators) RegisterViewGenerator

func (lv *ViewGenerators) RegisterViewGenerator(listType string, generator ViewGenerator)

func (*ViewGenerators) UnregisterViewGenerator

func (lv *ViewGenerators) UnregisterViewGenerator(listType string)

type ViewGeneratorsOption

type ViewGeneratorsOption interface {
	// contains filtered or unexported methods
}

func OptionFields

func OptionFields(fields string) ViewGeneratorsOption

func OptionFilter

func OptionFilter(filter string) ViewGeneratorsOption

func OptionLimit

func OptionLimit(limit int) ViewGeneratorsOption

func OptionOffset

func OptionOffset(offset int) ViewGeneratorsOption

func OptionSort

func OptionSort(sort string) ViewGeneratorsOption

func ParseOptionsFromGinContext

func ParseOptionsFromGinContext(c *gin.Context) []ViewGeneratorsOption

ParseOptionsFromGinContext parses the provided options from a gin context and returns an array of ViewGeneratorsOption

Jump to

Keyboard shortcuts

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