path

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 21 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 Audit

type Audit struct {
	URL     string              `yaml:"URL,omitempty"`
	Headers map[string][]string `yaml:"Headers,omitempty"`
}

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

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"`
	Version    version.Control `yaml:"-" json:"-"`
}

type Logger

type Logger struct {
	MinExecutionMs *int
}

type Path

type Path struct {
	contract.Path `yaml:",inline"`
	Settings      `yaml:",inline"`
	Handler       *Handler         `yaml:"Handler" json:"Handler"`
	Internal      bool             `json:"Internal,omitempty" yaml:"Internal,omitempty" `
	ContentURL    string           `json:"ContentURL,omitempty" yaml:"ContentURL,omitempty" `
	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 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

Jump to

Keyboard shortcuts

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