path

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: Apache-2.0 Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	PathFileName = "paths.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	URI    string        `yaml:"URI,omitempty"`
	Value  string        `yaml:"GetValue,omitempty"`
	Header string        `yaml:"Header,omitempty"`
	Secret *scy.Resource `yaml:"Secret,omitempty"`
}

func (*APIKey) Init

func (k *APIKey) Init(ctx context.Context) error

type APIKeys

type APIKeys []*APIKey

func (APIKeys) Init

func (a APIKeys) Init(ctx context.Context) error

func (APIKeys) Len

func (a APIKeys) Len() int

func (APIKeys) Less

func (a APIKeys) Less(i, j int) bool

func (APIKeys) Match

func (a APIKeys) Match(URI string) *APIKey

func (APIKeys) Swap

func (a APIKeys) Swap(i, j int)

type Compression

type Compression struct {
	MinSizeKb int `yaml:"MinSizeKb,omitempty"`
}

type Container

type Container struct {
	ModTime *time.Time `yaml:"ModTime,omitempty" json:",omitempty"`
	Items   []*Item    `yaml:"Items" json:"Items"`
}

type Cors

type Cors struct {
	AllowCredentials *bool     `yaml:"AllowCredentials,omitempty"`
	AllowHeaders     *[]string `yaml:"AllowHeaders,omitempty"`
	AllowMethods     *[]string `yaml:"AllowMethods,omitempty"`
	AllowOrigins     *[]string `yaml:"AllowOrigins,omitempty"`
	ExposeHeaders    *[]string `yaml:"ExposeHeaders,omitempty"`
	MaxAge           *int64    `yaml:"MaxAge,omitempty"`
}

func DefaultCors

func DefaultCors() *Cors

func (*Cors) Inherit added in v0.16.2

func (c *Cors) Inherit(cors *Cors)

func (*Cors) OriginMap added in v0.16.2

func (c *Cors) OriginMap() map[string]bool

type Handler added in v0.9.8

type Handler struct {
	MessageBus string `json:"MessageBus,omitempty" yaml:"MessageBus,omitempty" `
	With       []string
}

type Item

type Item struct {
	SourceURL  string  `yaml:"SourceURL"`
	MessageBus string  `json:"MessageBus,omitempty" yaml:"MessageBus,omitempty" `
	Paths      []*Path `yaml:"Routes" json:"Routes"`
	Settings   `yaml:",inline"`
	Resource   *Resource       `yaml:"Resource,omitempty" json:"Resource,omitempty"` // optional resource for the path
	Version    version.Control `yaml:"-" json:"-"`
}

type Logger

type Logger struct {
	MinExecutionMs *int
}

type Parameter added in v0.15.4

type Parameter struct {
	Name      string                       `json:"name" yaml:"Name"` // Name of the parameter
	In        *state.Location              `json:",omitempty" yaml:"In" `
	Required  bool                         `json:"required,omitempty" yaml:"Required,omitempty"` // Required indicates if the parameter is required
	Schema    *state.Schema                `json:"schema" yaml:"Schema"`
	Predicate []*extension.PredicateConfig `json:",omitempty" yaml:"Predicates"`
}

type Path

type Path struct {
	contract.Path                 `yaml:",inline"`
	Settings                      `yaml:",inline"`
	contract.Meta                 `yaml:",inline"`
	contract.ModelContextProtocol `yaml:",inline"`
	Handler                       *Handler         `yaml:"Handler" json:"Handler"`
	Internal                      bool             `json:"Internal,omitempty" yaml:"Internal,omitempty" `
	Connector                     string           `json:",omitempty"`
	ContentURL                    string           `json:"ContentURL,omitempty" yaml:"ContentURL,omitempty" `
	View                          *ViewRef         `yaml:"View" json:"View"` // View is the shared resource view for this path, used for OpenAPI generation
	SourceURL                     string           `yaml:"-" json:"-"`
	Version                       *version.Control `yaml:"-" json:"-"`
}

func (*Path) CorsEnabled

func (p *Path) CorsEnabled() bool

func (*Path) IsMetricDebug

func (p *Path) IsMetricDebug(req *http.Request) bool

func (*Path) IsMetricInfo

func (p *Path) IsMetricInfo(req *http.Request) bool

func (*Path) IsMetricsEnabled

func (p *Path) IsMetricsEnabled(req *http.Request) bool

func (*Path) IsRevealMetric

func (p *Path) IsRevealMetric() bool

type Redirect

type Redirect struct {
	StorageURL   string `yaml:"StorageURL,omitempty"` ///github.com/viant/datly/v0/app/lambda/lambda/proxy.go
	MinSizeKb    int    `yaml:"MinSizeKb,omitempty"`
	TimeToLiveMs int    `yaml:"TimeToLiveMs,omitempty"`
}

func (*Redirect) TimeToLive

func (r *Redirect) TimeToLive() time.Duration

type Resource added in v0.15.4

type Resource struct {
	Parameters []*Parameter           `json:",omitempty" yaml:"Parameters,omitempty"` // Parameters for the resource, used for OpenAPI generation
	Types      []*view.TypeDefinition `json:",omitempty" yaml:"Types,omitempty"`      // Type definitions for the resource, used for OpenAPI generation
}

type Service

type Service struct {
	Container Container
	URL       string

	MbusPaths []*Path
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, fs afs.Service, URL string, refreshFrequency time.Duration) (*Service, error)

func (*Service) Append

func (s *Service) Append(paths *Item)

func (*Service) FormatURL

func (s *Service) FormatURL(URI string) string

func (*Service) GetPaths

func (s *Service) GetPaths() Container

func (*Service) IncreaseVersion

func (s *Service) IncreaseVersion()

IncreaseVersion increase version of the all routes

func (*Service) Init

func (s *Service) Init(ctx context.Context) (err error)

func (*Service) IsCheckDue

func (s *Service) IsCheckDue(t time.Time) bool

func (*Service) Lookup

func (s *Service) Lookup(aPath *contract.Path) *Path

func (*Service) SyncChanges

func (s *Service) SyncChanges(ctx context.Context) (bool, error)

type Settings

type Settings struct {
	APIKey       *APIKey      `json:",omitempty"  yaml:"APIKey,omitempty"`
	Cors         *Cors        `json:",omitempty"  yaml:"Cors,omitempty"`
	Compression  *Compression `json:",omitempty"  yaml:"Compression,omitempty"`
	Redirect     *Redirect    `json:",omitempty"  yaml:"PreSign,omitempty"`
	Logger       *Logger      `json:",omitempty"  yaml:"Logger,omitempty"`
	RevealMetric *bool
	With         []string `yaml:"With" json:"With"`
}

func (*Settings) HasWith

func (r *Settings) HasWith(candidate string) bool

type ViewRef added in v0.15.4

type ViewRef struct {
	Ref string `yaml:"Ref" json:"Ref"` // Ref is the reference to the view definition
}

Jump to

Keyboard shortcuts

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