resources

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrCannotDeleteCollection

func ErrCannotDeleteCollection(name, reason string) error

func ErrCannotDeleteDomain

func ErrCannotDeleteDomain(name, reason string) error

func ErrCannotDeleteModule

func ErrCannotDeleteModule(name, reason string) error

func ErrCannotDeleteNamespace

func ErrCannotDeleteNamespace(name, reason string) error

func ErrCannotDeleteRoute

func ErrCannotDeleteRoute(name, reason string) error

func ErrCannotDeleteSecret added in v0.8.0

func ErrCannotDeleteSecret(name, reason string) error

func ErrCannotDeleteService

func ErrCannotDeleteService(name, reason string) error

func ErrCollectionNotFound

func ErrCollectionNotFound(name string) error

func ErrDomainNotFound

func ErrDomainNotFound(name string) error

func ErrModuleNotFound

func ErrModuleNotFound(name string) error

func ErrNamespaceNotFound

func ErrNamespaceNotFound(name string) error

func ErrRouteNotFound

func ErrRouteNotFound(name string) error

func ErrSecretNotFound added in v0.8.0

func ErrSecretNotFound(name string) error

func ErrServiceNotFound

func ErrServiceNotFound(name string) error

Types

type DocumentManager

type DocumentManager interface {
	GetDocumentByID(namespace, collection, id string) (*spec.Document, error)
	GetDocuments(collection, namespace string, limit, offset int) ([]*spec.Document, error)
}

type Options

type Options func(*ResourceManager)

func WithDefaultNamespace

func WithDefaultNamespace(ns *spec.Namespace) Options

type ResourceManager

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

ResourceManager is a struct that handles all resources and their links between each other

func NewManager

func NewManager(opts ...Options) *ResourceManager

func (*ResourceManager) AddCollection

func (rm *ResourceManager) AddCollection(collection *spec.Collection) (*spec.DGateCollection, error)

func (*ResourceManager) AddDomain

func (rm *ResourceManager) AddDomain(domain *spec.Domain) (*spec.DGateDomain, error)

func (*ResourceManager) AddModule

func (rm *ResourceManager) AddModule(module *spec.Module) (*spec.DGateModule, error)

func (*ResourceManager) AddNamespace

func (rm *ResourceManager) AddNamespace(ns *spec.Namespace) *spec.DGateNamespace

func (*ResourceManager) AddRoute

func (rm *ResourceManager) AddRoute(route *spec.Route) (rt *spec.DGateRoute, err error)

func (*ResourceManager) AddSecret added in v0.8.0

func (rm *ResourceManager) AddSecret(secret *spec.Secret) (*spec.DGateSecret, error)

func (*ResourceManager) AddService

func (rm *ResourceManager) AddService(service *spec.Service) (*spec.DGateService, error)

func (*ResourceManager) Clear added in v0.8.0

func (rm *ResourceManager) Clear()

Clear removes all resources from the resource manager

func (*ResourceManager) DomainCountEquals added in v0.8.0

func (rm *ResourceManager) DomainCountEquals(target int) bool

func (*ResourceManager) Empty

func (rm *ResourceManager) Empty() bool

Empty returns true if the resource manager is empty

func (*ResourceManager) GetCollection

func (rm *ResourceManager) GetCollection(name, namespace string) (*spec.DGateCollection, bool)

func (*ResourceManager) GetCollections

func (rm *ResourceManager) GetCollections() []*spec.DGateCollection

GetCollections returns a list of all collections

func (*ResourceManager) GetCollectionsByNamespace

func (rm *ResourceManager) GetCollectionsByNamespace(namespace string) []*spec.DGateCollection

func (*ResourceManager) GetDomain

func (rm *ResourceManager) GetDomain(name, namespace string) (*spec.DGateDomain, bool)

func (*ResourceManager) GetDomains

func (rm *ResourceManager) GetDomains() []*spec.DGateDomain

GetDomains returns a list of all domains

func (*ResourceManager) GetDomainsByNamespace

func (rm *ResourceManager) GetDomainsByNamespace(namespace string) []*spec.DGateDomain

GetDomainsByNamespace returns a list of all domains in a namespace

func (*ResourceManager) GetDomainsByPriority added in v0.8.0

func (rm *ResourceManager) GetDomainsByPriority() []*spec.DGateDomain

GetDomainsByPriority returns a list of all domains sorted by priority and name

func (*ResourceManager) GetFirstNamespace added in v0.8.0

func (rm *ResourceManager) GetFirstNamespace() *spec.DGateNamespace

func (*ResourceManager) GetModule

func (rm *ResourceManager) GetModule(name, namespace string) (*spec.DGateModule, bool)

func (*ResourceManager) GetModules

func (rm *ResourceManager) GetModules() []*spec.DGateModule

GetModules returns a list of all modules

func (*ResourceManager) GetModulesByNamespace

func (rm *ResourceManager) GetModulesByNamespace(namespace string) []*spec.DGateModule

GetModulesByNamespace returns a list of all modules in a namespace

func (*ResourceManager) GetNamespace

func (rm *ResourceManager) GetNamespace(namespace string) (*spec.DGateNamespace, bool)

func (*ResourceManager) GetNamespaces

func (rm *ResourceManager) GetNamespaces() []*spec.DGateNamespace

GetNamespaces returns a list of all namespaces

func (*ResourceManager) GetRoute

func (rm *ResourceManager) GetRoute(name, namespace string) (*spec.DGateRoute, bool)

Route functions

func (*ResourceManager) GetRouteModules

func (rm *ResourceManager) GetRouteModules(name, namespace string) ([]*spec.DGateModule, bool)

GetRouteModules returns a list of all modules in a route

func (*ResourceManager) GetRouteNamespaceMap

func (rm *ResourceManager) GetRouteNamespaceMap() map[string][]*spec.DGateRoute

GetRouteNamespaceMap returns a map of all routes and their namespaces as the key

func (*ResourceManager) GetRoutes

func (rm *ResourceManager) GetRoutes() []*spec.DGateRoute

GetRoutes returns a list of all routes

func (*ResourceManager) GetRoutesByNamespace

func (rm *ResourceManager) GetRoutesByNamespace(namespace string) []*spec.DGateRoute

GetRoutesByNamespace returns a list of all routes in a namespace

func (*ResourceManager) GetSecret added in v0.8.0

func (rm *ResourceManager) GetSecret(name, namespace string) (*spec.DGateSecret, bool)

func (*ResourceManager) GetSecrets added in v0.8.0

func (rm *ResourceManager) GetSecrets() []*spec.DGateSecret

GetSecrets returns a list of all secrets

func (*ResourceManager) GetSecretsByNamespace added in v0.8.0

func (rm *ResourceManager) GetSecretsByNamespace(namespace string) []*spec.DGateSecret

GetSecretsByNamespace returns a list of all secrets in a namespace

func (*ResourceManager) GetService

func (rm *ResourceManager) GetService(name, namespace string) (*spec.DGateService, bool)

func (*ResourceManager) GetServices

func (rm *ResourceManager) GetServices() []*spec.DGateService

GetServices returns a list of all services

func (*ResourceManager) GetServicesByNamespace

func (rm *ResourceManager) GetServicesByNamespace(namespace string) []*spec.DGateService

GetServicesByNamespace returns a list of all services in a namespace

func (*ResourceManager) NamespaceCountEquals added in v0.8.0

func (rm *ResourceManager) NamespaceCountEquals(target int) bool

func (*ResourceManager) RemoveCollection

func (rm *ResourceManager) RemoveCollection(name, namespace string) error

func (*ResourceManager) RemoveDomain

func (rm *ResourceManager) RemoveDomain(name, namespace string) error

func (*ResourceManager) RemoveModule

func (rm *ResourceManager) RemoveModule(name, namespace string) error

func (*ResourceManager) RemoveNamespace

func (rm *ResourceManager) RemoveNamespace(namespace string) error

func (*ResourceManager) RemoveRoute

func (rm *ResourceManager) RemoveRoute(name, namespace string) error

RemoveRoute removes a route from the resource manager

func (*ResourceManager) RemoveSecret added in v0.8.0

func (rm *ResourceManager) RemoveSecret(name, namespace string) error

func (*ResourceManager) RemoveService

func (rm *ResourceManager) RemoveService(name, namespace string) error

Jump to

Keyboard shortcuts

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