router

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RoutingConfig string `json:"routingConfig"`
}

Config holds the configuration for the Router plugin.

type Router

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

Router implements Router interface.

func New

func New(ctx context.Context, config *Config) (*Router, func() error, error)

New initializes a new Router instance with the provided configuration. It loads and validates the routing rules from the specified YAML file. Returns an error if the configuration is invalid or the rules cannot be loaded.

func (*Router) Route

func (r *Router) Route(ctx context.Context, url *url.URL, body []byte) (*model.Route, error)

Route determines the routing destination based on the request context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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