Documentation ¶
Index ¶
- func ErrCannotDeleteCollection(name, reason string) error
- func ErrCannotDeleteDomain(name, reason string) error
- func ErrCannotDeleteModule(name, reason string) error
- func ErrCannotDeleteNamespace(name, reason string) error
- func ErrCannotDeleteRoute(name, reason string) error
- func ErrCannotDeleteService(name, reason string) error
- func ErrCollectionNotFound(name string) error
- func ErrDomainNotFound(name string) error
- func ErrModuleNotFound(name string) error
- func ErrNamespaceNotFound(name string) error
- func ErrRouteNotFound(name string) error
- func ErrServiceNotFound(name string) error
- type DocumentManager
- type Options
- type ResourceManager
- func (rm *ResourceManager) AddCollection(collection *spec.Collection) (*spec.DGateCollection, error)
- func (rm *ResourceManager) AddDomain(domain *spec.Domain) (*spec.DGateDomain, error)
- func (rm *ResourceManager) AddModule(module *spec.Module) (*spec.DGateModule, error)
- func (rm *ResourceManager) AddNamespace(ns *spec.Namespace) *spec.DGateNamespace
- func (rm *ResourceManager) AddRoute(route *spec.Route) (rt *spec.DGateRoute, err error)
- func (rm *ResourceManager) AddService(service *spec.Service) (*spec.DGateService, error)
- func (rm *ResourceManager) Empty() bool
- func (rm *ResourceManager) GetCollection(name, namespace string) (*spec.DGateCollection, bool)
- func (rm *ResourceManager) GetCollections() []*spec.DGateCollection
- func (rm *ResourceManager) GetCollectionsByNamespace(namespace string) []*spec.DGateCollection
- func (rm *ResourceManager) GetDomain(name, namespace string) (*spec.DGateDomain, bool)
- func (rm *ResourceManager) GetDomains() []*spec.DGateDomain
- func (rm *ResourceManager) GetDomainsByNamespace(namespace string) []*spec.DGateDomain
- func (rm *ResourceManager) GetModule(name, namespace string) (*spec.DGateModule, bool)
- func (rm *ResourceManager) GetModules() []*spec.DGateModule
- func (rm *ResourceManager) GetModulesByNamespace(namespace string) []*spec.DGateModule
- func (rm *ResourceManager) GetNamespace(namespace string) (*spec.DGateNamespace, bool)
- func (rm *ResourceManager) GetNamespaces() []*spec.DGateNamespace
- func (rm *ResourceManager) GetRoute(name, namespace string) (*spec.DGateRoute, bool)
- func (rm *ResourceManager) GetRouteModules(name, namespace string) ([]*spec.DGateModule, bool)
- func (rm *ResourceManager) GetRouteNamespaceMap() map[string][]*spec.DGateRoute
- func (rm *ResourceManager) GetRoutes() []*spec.DGateRoute
- func (rm *ResourceManager) GetRoutesByNamespace(namespace string) []*spec.DGateRoute
- func (rm *ResourceManager) GetService(name, namespace string) (*spec.DGateService, bool)
- func (rm *ResourceManager) GetServices() []*spec.DGateService
- func (rm *ResourceManager) GetServicesByNamespace(namespace string) []*spec.DGateService
- func (rm *ResourceManager) MarshalJSON() ([]byte, error)
- func (rm *ResourceManager) RemoveCollection(name, namespace string) error
- func (rm *ResourceManager) RemoveDomain(name, namespace string) error
- func (rm *ResourceManager) RemoveModule(name, namespace string) error
- func (rm *ResourceManager) RemoveNamespace(namespace string) error
- func (rm *ResourceManager) RemoveRoute(name, namespace string) error
- func (rm *ResourceManager) RemoveService(name, namespace string) error
- func (rm *ResourceManager) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrCannotDeleteDomain ¶
func ErrCannotDeleteModule ¶
func ErrCannotDeleteRoute ¶
func ErrCannotDeleteService ¶
func ErrCollectionNotFound ¶
func ErrDomainNotFound ¶
func ErrModuleNotFound ¶
func ErrNamespaceNotFound ¶
func ErrRouteNotFound ¶
func ErrServiceNotFound ¶
Types ¶
type DocumentManager ¶
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) AddService ¶
func (rm *ResourceManager) AddService(service *spec.Service) (*spec.DGateService, error)
func (*ResourceManager) Empty ¶
func (rm *ResourceManager) Empty() bool
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) 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) 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) MarshalJSON ¶
func (rm *ResourceManager) MarshalJSON() ([]byte, error)
MarshalJSON marshals the resource manager to json
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) RemoveService ¶
func (rm *ResourceManager) RemoveService(name, namespace string) error
func (*ResourceManager) UnmarshalJSON ¶
func (rm *ResourceManager) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the resource manager from json