Documentation
¶
Index ¶
- func CacheMiddleware(cache *expirable.LRU[string, []byte]) gin.HandlerFunc
- func ConfDir() (string, error)
- func GetCache(c *gin.Context) *expirable.LRU[string, []byte]
- func HandleError(c *gin.Context, err error)
- func LogDir() (string, error)
- type BstoreError
- type CORSConfig
- type CacheConfig
- type IPRateLimiter
- type ListResponse
- type MiddlewareConfig
- type RateLimitConfig
- type ReqValidation
- type ServerCfg
- func (bstore *ServerCfg) Cors(r *gin.Engine)
- func (bstore *ServerCfg) Delete(c *gin.Context)
- func (bstore *ServerCfg) Get(c *gin.Context)
- func (bstore *ServerCfg) GetAccess(c *gin.Context) string
- func (bstore *ServerCfg) GetRWKey() string
- func (bstore *ServerCfg) List(c *gin.Context)
- func (cfg *ServerCfg) Load(conf_file string) error
- func (bstore *ServerCfg) MakeUrl(c *gin.Context, fpath string) string
- func (bstore *ServerCfg) Middleware(r *gin.Engine)
- func (cfg *ServerCfg) Print()
- func (bstore *ServerCfg) Serve() gin.HandlerFunc
- func (bstore *ServerCfg) Upload(c *gin.Context)
- func (bstore *ServerCfg) ValidateReq(c *gin.Context) ReqValidation
- type StreamResponse
- type StreamingConfig
- type UploadRespone
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheMiddleware ¶ added in v0.2.21
func HandleError ¶
Types ¶
type BstoreError ¶
func (*BstoreError) Error ¶
func (e *BstoreError) Error() string
type CORSConfig ¶
type CacheConfig ¶ added in v0.2.21
type IPRateLimiter ¶
type IPRateLimiter struct {
// contains filtered or unexported fields
}
func NewIPRateLimiter ¶
func NewIPRateLimiter(capacity int) *IPRateLimiter
func (*IPRateLimiter) CheckRateLimit ¶
type ListResponse ¶
type MiddlewareConfig ¶
type MiddlewareConfig struct {
MaxPathLength int `yaml:"max_path_length"`
OnlyBstorePaths bool `yaml:"only_bstore_paths"`
RateLimitCapacity int64 `yaml:"rate_limit_capacity"`
RateLimit RateLimitConfig `yaml:"rate_limit"`
}
type RateLimitConfig ¶
type ReqValidation ¶
type ServerCfg ¶
type ServerCfg struct {
Host string `yaml:"host"`
Keys string `yaml:"keys"`
PublicBasePath string `yaml:"public_base_path"`
PrivateBasePath string `yaml:"private_base_path"`
MaxFileSize int64 `yaml:"max_file_size"`
LogFile string `yaml:"log_file"`
Encrypt bool `yaml:"encrypt"`
Compress bool `yaml:"compress"`
CompressionLevel int `yaml:"compression_lvl"`
Cache CacheConfig `yaml:"cache"`
Streaming StreamingConfig `yaml:"streaming"`
CORS CORSConfig `yaml:"cors"`
MWare MiddlewareConfig `yaml:"middleware"`
}
func (*ServerCfg) Middleware ¶
func (*ServerCfg) Serve ¶
func (bstore *ServerCfg) Serve() gin.HandlerFunc
func (*ServerCfg) ValidateReq ¶
func (bstore *ServerCfg) ValidateReq(c *gin.Context) ReqValidation
type StreamResponse ¶ added in v0.2.12
type StreamingConfig ¶ added in v0.2.11
type UploadRespone ¶
type UploadRespone struct {
Url string `json:"url"`
Message string `json:"message"`
Stream StreamResponse `json:"stream"`
}
Click to show internal directories.
Click to hide internal directories.