k8s

package
v0.0.0-...-baa8b21 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type CommonSetup

type CommonSetup interface {
	Generate(svcs apis.ServiceGraph) ([]runtime.Object, []byte, error)
}

type CommonSetupFn

type CommonSetupFn func(svcs apis.ServiceGraph) ([]runtime.Object, []byte, error)

func (CommonSetupFn) Generate

func (f CommonSetupFn) Generate(svcs apis.ServiceGraph) ([]runtime.Object, []byte, error)

type Formatters

type Formatters struct {
	BaseName string
	Name     func(idx int) string
	Url      func(idx int, port int) string
}

func SimpleFormatters

func SimpleFormatters(baseName string) Formatters

type Generator

type Generator struct {
	CommonSetup       CommonSetup
	WorkloadGenerator WorkloadGenerator
	Serializer        *json.Serializer
}

func NewGenerator

func NewGenerator(opts ...Option) (Generator, error)

func (Generator) Apply

func (e Generator) Apply(writer io.Writer, svc apis.ServiceGraph) error

type Option

type Option interface {
	Apply(g *generator) error
}

func AsStatefulSet

func AsStatefulSet() Option

func WithConfigMapGenerator

func WithConfigMapGenerator(fn func(f Formatters, svc apis.Service) (string, error)) Option

func WithFormatters

func WithFormatters(f Formatters) Option

func WithImage

func WithImage(image string) Option

func WithNamespace

func WithNamespace(name string) Option

func WithPodTemplateSpecMutator

func WithPodTemplateSpecMutator(fn func(f Formatters, svc apis.Service, template *v1.PodTemplateSpec) error) Option

func WithPort

func WithPort(p int) Option

type OptionFn

type OptionFn func(g *generator) error

func (OptionFn) Apply

func (f OptionFn) Apply(g *generator) error

type ServiceGeneratorError

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

func (*ServiceGeneratorError) Error

func (s *ServiceGeneratorError) Error() string

func (*ServiceGeneratorError) Is

func (s *ServiceGeneratorError) Is(target error) bool

func (*ServiceGeneratorError) Unwrap

func (s *ServiceGeneratorError) Unwrap() error

type WorkloadGenerator

type WorkloadGenerator interface {
	Apply(svc apis.Service) ([]runtime.Object, []byte, error)
}

type WorkloadGeneratorFn

type WorkloadGeneratorFn func(svc apis.Service) ([]runtime.Object, []byte, error)

func (WorkloadGeneratorFn) Apply

func (f WorkloadGeneratorFn) Apply(svc apis.Service) ([]runtime.Object, []byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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