route

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// Routes collection name
	RoutesCollectionName = "routes"
)
View Source
const (
	// internal services database name
	ServicesDatabaseName = "services"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	Url    string     `bson:"url,omitempty"`
	Method MethodType `bson:"method,omitempty"`
}

type MethodType

type MethodType int32
const (
	GET MethodType = iota
	HEAD
	POST
	PUT
	PATCH
	DELETE
	CONNECT
	OPTIONS
	TRACE
)

type Route

type Route struct {
	Key      *Key   `bson:"key,omitempty"`
	Endpoint string `bson:"endpoint,omitempty"`

	// If the route is publically accessible, then rest of the fields
	// below are not relevant
	IsPublic *bool `bson:"isPublic,omitempty"`

	// Route is supposed to be accessible only for root tenancy
	IsRoot *bool `bson:"isRoot,omitempty"`

	// if route is user specific RBAC constructs are not valid, rest of
	// the fields below are not relevant
	IsUserSpecific *bool `bson:"isUserSpecific,omitempty"`

	// RBAC constructs associated with Route
	Group    string `bson:"group,omitempty"`
	Resource string `bson:"resource,omitempty"`
	Verb     string `bson:"verb,omitempty"`

	// if this is a scoped route, this array would be non empty
	// well at the moment, only a single scope will be enabled
	// that too will be only organisation unit.
	// if first scope is not ou, then it is assumed to be
	// equivalent to be empty and hence not scoped
	Scopes []string `bson:"scopes,omitempty"`
}

type RouteTable

type RouteTable struct {
	table.Table[Key, Route]
	// contains filtered or unexported fields
}

func GetRouteTable

func GetRouteTable() (*RouteTable, error)

func LocateRouteTable

func LocateRouteTable(client db.StoreClient) (*RouteTable, error)

Jump to

Keyboard shortcuts

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