Documentation ¶
Index ¶
- Constants
- func CorsHandler(request *http.Request, cors *path.Cors) func(writer http.ResponseWriter)
- func ExtractCacheableViews(ctx context.Context, component *repository.Component) ([]*view.View, error)
- func Sanitize(request *http.Request, aPath *path.Path, headers http.Header, ...)
- type ContextHandler
- type Handler
- func (r *Handler) AuthorizeRequest(request *http.Request, aPath *path.Path) error
- func (r *Handler) Handle(ctx context.Context, writer http.ResponseWriter, request *http.Request)
- func (r *Handler) HandleRequest(ctx context.Context, response http.ResponseWriter, request *http.Request)
- func (r *Handler) PreSign(ctx context.Context, viewName string, aResponse response.Response) (*option.PreSign, error)
- func (r *Handler) Serve(serverPath string) error
- func (r *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request)
- type Logger
- type Metrics
- type Resource
- type ResponseWithMetrics
- type Route
- func (r *Route) AddApiKeys(keys ...*path.APIKey)
- func (r *Route) CorsEnabled() bool
- func (r *Route) HttpURI() string
- func (r *Route) Init(ctx context.Context, resource *Resource) error
- func (r *Route) IsCacheDisabled(req *http.Request) bool
- func (r *Route) IsMetricDebug(req *http.Request) bool
- func (r *Route) IsMetricInfo(req *http.Request) bool
- func (r *Route) IsMetricsEnabled(req *http.Request) bool
- func (r *Route) PgkPath(fieldName string) string
- func (r *Route) SetRouteLookup(lookup func(route *http2.Route) (*Route, error))
- func (r *Route) UnmarshalFunc(request *http.Request) shared.Unmarshal
- type Routes
Constants ¶
View Source
const (
HeaderContentType = "Content-Type"
)
View Source
const (
Separator = ", "
)
Variables ¶
This section is empty.
Functions ¶
func CorsHandler ¶
func ExtractCacheableViews ¶
Types ¶
type ContextHandler ¶
ContextHandler http handler with context
type Handler ¶
type Handler struct { Path *path.Path Provider *repository.Provider // contains filtered or unexported fields }
func New ¶
func New(aPath *path.Path, provider *repository.Provider, registry *repository.Registry) *Handler
func (*Handler) AuthorizeRequest ¶
func (*Handler) HandleRequest ¶
type Resource ¶
type Resource struct { URL string `json:",omitempty" yaml:",omitempty"` SourceURL string `json:",omitempty"` With []string //list of resource to inherit from `json:",omitempty"` Routes Routes Compression *path.Compression `json:",omitempty"` Redirect *path.Redirect `json:",omitempty"` Logger *path.Logger `json:",omitempty"` //connect, dataview, time, SQL with params if exceeded time `json:",omitempty"` Cors *path.Cors `json:",omitempty"` ColumnsCache *discover.Columns `json:",omitempty"` RevealMetric *bool `json:",omitempty"` ColumnsDiscovery bool `json:",omitempty"` EnableDebug *bool `json:",omitempty"` Resource *view.Resource // contains filtered or unexported fields }
deprecated TODO replace with repository.Components
type ResponseWithMetrics ¶
type ResponseWithMetrics struct { http.ResponseWriter // contains filtered or unexported fields }
func NewMetricResponse ¶
func NewMetricResponse(writer http.ResponseWriter) *ResponseWithMetrics
func NewMetricResponseWithTime ¶
func NewMetricResponseWithTime(writer http.ResponseWriter, start time.Time) *ResponseWithMetrics
func (*ResponseWithMetrics) WriteHeader ¶
func (r *ResponseWithMetrics) WriteHeader(statusCode int)
type Route ¶
type Route struct { APIKey *path.APIKey `json:",omitempty"` Cors *path.Cors `json:",omitempty"` Internal bool `json:"Internal,omitempty" yaml:"Internal,omitempty" ` ContentURL string `json:"ContentURL,omitempty" yaml:"ContentURL,omitempty" ` EnableAudit bool `json:",omitempty"` EnableDebug *bool `json:",omitempty"` Compression *path.Compression `json:",omitempty"` Transforms marshal.Transforms `json:",omitempty"` repository.Component // contains filtered or unexported fields }
deprecated
func (*Route) AddApiKeys ¶
func (*Route) CorsEnabled ¶
func (*Route) SetRouteLookup ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.