schema

package
v0.0.0-...-09e780c Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapServer

func WrapServer(factory Factory, server *server.Server) http.Handler

Types

type Collection

type Collection struct {
	// contains filtered or unexported fields
}

func NewCollection

func NewCollection(ctx context.Context, baseSchema *types.APISchemas, access accesscontrol.AccessSetLookup) *Collection

func (*Collection) AddTemplate

func (c *Collection) AddTemplate(templates ...Template)

func (*Collection) ByGVK

func (c *Collection) ByGVK(gvk schema.GroupVersionKind) string

func (*Collection) ByGVR

func (*Collection) IDs

func (c *Collection) IDs() (result []string)

func (*Collection) OnChange

func (c *Collection) OnChange(ctx context.Context, cb func())

func (*Collection) Reset

func (c *Collection) Reset(schemas map[string]*types.APISchema)

func (*Collection) Schema

func (c *Collection) Schema(id string) *types.APISchema

func (*Collection) Schemas

func (c *Collection) Schemas(user user.Info) (*types.APISchemas, error)

type Factory

type Factory interface {
	Schemas(user user.Info) (*types.APISchemas, error)
	ByGVR(gvr schema.GroupVersionResource) string
	ByGVK(gvr schema.GroupVersionKind) string
	OnChange(ctx context.Context, cb func())
	AddTemplate(template ...Template)
}

type Template

type Template struct {
	Group        string
	Kind         string
	ID           string
	Customize    func(*types.APISchema)
	Formatter    types.Formatter
	Store        types.Store
	Start        func(ctx context.Context) error
	StoreFactory func(types.Store) types.Store
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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