Documentation ¶
Index ¶
- Constants
- func Compress(reader io.Reader) (*bytes.Buffer, error)
- func CreateSelectors(ctx context.Context, dateFormat string, inputFormat format.Case, ...) (*view.Selectors, error)
- func CreateSelectorsFromRoute(ctx context.Context, route *Route, request *http.Request, ...) (*view.Selectors, error)
- func GenerateGoStruct(name string, structType reflect.Type) string
- func GenerateOpenAPI3Spec(info openapi3.Info, routes ...*Route) (*openapi3.OpenAPI, error)
- type ApiPrefix
- type Audit
- type BytesReadCloser
- type BytesReader
- type Compression
- type Cors
- type Error
- type Errors
- type Index
- type Logger
- type Matcher
- type Node
- type NodeMatch
- type Output
- type Param
- type ParamError
- type ParamErrors
- type PayloadReader
- type QueryParam
- type Redirect
- type RequestMetadata
- type RequestParams
- type Resource
- type ResponseStatus
- type Route
- type Router
- func (r *Router) ApiPrefix() string
- func (r *Router) Handle(response http.ResponseWriter, request *http.Request) error
- func (r *Router) Init(routes Routes, apiPrefix string)
- func (r *Router) Routes(route string) []*Route
- func (r *Router) Serve(serverPath string) error
- func (r *Router) ServeHTTP(writer http.ResponseWriter, request *http.Request)
- func (r *Router) View(name string) (*view.View, error)
- type Routes
- type SelectorParamIt
- type ServiceType
- type Style
- type ViewDetails
Constants ¶
View Source
const ( //ContentTypeJSON json content type ContentTypeJSON = "application/json" CharsetUTF8 = "charset=utf-8" //EncodingGzip encoding gzip EncodingGzip = "gzip" ContentLength = "Content-Length" )
View Source
const ( BasicStyle Style = "Basic" ComprehensiveStyle Style = "Comprehensive" ReaderServiceType ServiceType = "Reader" )
View Source
const ( AllowOriginHeader = "Access-Control-Allow-Origin" AllowHeadersHeader = "Access-Control-Allow-Headers" AllowMethodsHeader = "Access-Control-Allow-Methods" AllowCredentialsHeader = "Access-Control-Allow-Credentials" ExposeHeadersHeader = "Access-Control-Expose-Headers" MaxAgeHeader = "Access-Control-Max-Age" Separator = ", " )
View Source
const (
ValuesSeparator = ','
)
Variables ¶
This section is empty.
Functions ¶
func CreateSelectors ¶
func CreateSelectors(ctx context.Context, dateFormat string, inputFormat format.Case, requestMetadata *RequestMetadata, requestParams *RequestParams, views ...*ViewDetails) (*view.Selectors, error)
func GenerateGoStruct ¶ added in v0.2.4
Types ¶
type BytesReadCloser ¶ added in v0.2.2
type BytesReadCloser struct {
// contains filtered or unexported fields
}
func (*BytesReadCloser) Close ¶ added in v0.2.2
func (b *BytesReadCloser) Close() error
type BytesReader ¶ added in v0.2.2
type BytesReader struct {
// contains filtered or unexported fields
}
func AsBytesReader ¶ added in v0.2.2
func AsBytesReader(buffer *bytes.Buffer, compression string, size int) *BytesReader
func NewBytesReader ¶ added in v0.2.2
func NewBytesReader(data []byte, compression string) *BytesReader
func (*BytesReader) Close ¶ added in v0.2.2
func (b *BytesReader) Close() error
func (*BytesReader) CompressionType ¶ added in v0.2.2
func (b *BytesReader) CompressionType() string
func (*BytesReader) Size ¶ added in v0.2.2
func (b *BytesReader) Size() int
type Compression ¶
type Compression struct {
MinSizeKb int
}
type Error ¶ added in v0.2.1
type Error struct { View string `json:",omitempty" default:"nullable=true,required=false,allowEmpty=true"` Param string `json:",omitempty" default:"nullable=true,required=false,allowEmpty=true"` Err error `json:"-"` Message string `json:",omitempty" default:"nullable=true,required=false,allowEmpty=true"` Object interface{} `json:",omitempty" default:"nullable=true,required=false,allowEmpty=true"` }
type Errors ¶ added in v0.2.1
type Errors struct { Errors []*Error // contains filtered or unexported fields }
type Matcher ¶ added in v0.2.7
func NewMatcher ¶ added in v0.2.7
type Node ¶ added in v0.2.7
type Output ¶
type Output struct { Cardinality view.Cardinality `json:",omitempty"` CaseFormat view.CaseFormat `json:",omitempty"` OmitEmpty bool `json:",omitempty"` Style Style `json:",omitempty"` ResponseField string `json:",omitempty"` Transforms marshal.Transforms Exclude []string NormalizeExclude *bool DateFormat string `json:",omitempty"` // contains filtered or unexported fields }
type ParamError ¶ added in v0.2.1
type ParamErrors ¶ added in v0.2.1
type ParamErrors []*ParamError
func NewParamErrors ¶ added in v0.2.1
func NewParamErrors(validationErrors validator.ValidationErrors) ParamErrors
func (ParamErrors) Error ¶ added in v0.2.1
func (p ParamErrors) Error() string
type PayloadReader ¶ added in v0.2.2
type QueryParam ¶
type QueryParam string
const ( Fields QueryParam = "_fields" Offset QueryParam = "_offset" OrderBy QueryParam = "_orderby" Limit QueryParam = "_limit" Criteria QueryParam = "_criteria" Page QueryParam = "_page" )
func (QueryParam) Description ¶ added in v0.2.1
func (q QueryParam) Description(viewName string) string
func (QueryParam) ParamType ¶ added in v0.2.1
func (q QueryParam) ParamType() reflect.Type
type Redirect ¶
type Redirect struct { StorageURL string ///github.com/viant/datly/v0/app/lambda/lambda/proxy.go MinSizeKb int TimeToLiveMs int }
func (*Redirect) TimeToLive ¶ added in v0.2.1
type RequestMetadata ¶
func NewRequestMetadata ¶
func NewRequestMetadata(route *Route) *RequestMetadata
type RequestParams ¶
type RequestParams struct {
// contains filtered or unexported fields
}
func NewRequestParameters ¶
func NewRequestParameters(request *http.Request, route *Route) (*RequestParams, error)
type Resource ¶
type Resource struct { APIURI string MetaCacheURI string SourceURL string With []string //list of resource to inherit from Routes Routes Resource *view.Resource Compression *Compression Redirect *Redirect Cache *cache.Cache Logger *Logger //connect, dataview, time, SQL with params if exceeded time Cors *Cors ColumnsCache *discover.Cache ParamStatusError *int Info openapi3.Info ColumnsDiscovery bool // contains filtered or unexported fields }
func NewResourceFromURL ¶
type ResponseStatus ¶
type ResponseStatus struct { Status string `json:",omitempty"` Message interface{} `json:",omitempty"` }
type Route ¶
type Route struct { Visitor *codec.Visitor URI string Method string Service ServiceType View *view.View Cors *Cors EnableAudit bool Output Index ParamStatusError *int Cache *cache.Cache Compression *Compression // contains filtered or unexported fields }
func (*Route) PrefixByView ¶ added in v0.2.1
func (*Route) ShouldNormalizeExclude ¶ added in v0.2.1
type Router ¶
type Router struct { Matcher *Matcher // contains filtered or unexported fields }
type SelectorParamIt ¶
type SelectorParamIt struct {
// contains filtered or unexported fields
}
func NewParamIt ¶
func NewParamIt(value string, separators ...int32) *SelectorParamIt
func (*SelectorParamIt) Has ¶
func (s *SelectorParamIt) Has() bool
func (*SelectorParamIt) Next ¶
func (s *SelectorParamIt) Next() (Param, error)
type ServiceType ¶
type ServiceType string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.