Documentation ¶
Index ¶
- Constants
- func AudioLenQuota(next http.Handler, field string, srv AudioLenGetter) http.Handler
- func CleanHeader(next http.Handler, starting string) (http.Handler, error)
- func FillHeader(next http.Handler) http.Handler
- func FillKeyHeader(next http.Handler) http.Handler
- func FillOutHeader(next http.Handler) http.Handler
- func FillRequestIDHeader(next http.Handler, dbName string) http.Handler
- func GetInfo(pr string, h interface{}) string
- func IPAsKey(next http.Handler, ipSaver IPSaver) http.Handler
- func JSONAsQuota(next http.Handler) http.Handler
- func JSONTTSAsQuota(next http.Handler, discount float64) (http.Handler, error)
- func KeyExtract(next http.Handler) http.Handler
- func KeyValid(next http.Handler, kv KeyValidator) http.Handler
- func KeyValidOrIP(withKeyHandler http.Handler, withIPHandler http.Handler) http.Handler
- func LogDB(next http.Handler, dbs DBSaver) http.Handler
- func LogShitf(str string) string
- func LogStdout(next http.Handler) http.Handler
- func Proxy(url *url.URL) http.Handler
- func QuotaValidate(next http.Handler, qv QuotaValidator) http.Handler
- func RequestAsQuota(next http.Handler) http.Handler
- func SkipFirstQuota(next http.Handler, cg CountGetter) http.Handler
- func StripPrefix(next http.Handler, prefix string) http.Handler
- func TakeJSON(next http.Handler, field string) http.Handler
- func TakeJSONTTS(next http.Handler) http.Handler
- func ToTextAndQuota(next http.Handler, field string, srv TextGetter) http.Handler
- type AudioLenGetter
- type CountGetter
- type DBSaver
- type IPSaver
- type KeyValidator
- type QuotaValidator
- type TextGetter
Constants ¶
const ( // CtxContext context key for custom context object CtxContext key = iota )
Variables ¶
This section is empty.
Functions ¶
func AudioLenQuota ¶
AudioLenQuota creates handler
func CleanHeader ¶
CleanHeader removes header with key names starting with 'starting' from request
func FillHeader ¶
FillHeader creates handler for filling header values from tags
func FillKeyHeader ¶
FillKeyHeader creates handler for adding key hash value into "x-tts-save-tags"
func FillOutHeader ¶
FillOutHeader creates handler for filling header out values from tags starting with x-header-out:
func FillRequestIDHeader ¶
FillRequestIDHeader creates handler for adding requestID into header x-doorman-requestid"
func JSONTTSAsQuota ¶
JSONTTSAsQuota creates handler
func KeyValid ¶
func KeyValid(next http.Handler, kv KeyValidator) http.Handler
KeyValid creates handler
func KeyValidOrIP ¶
KeyValidOrIP creates handler
func QuotaValidate ¶
func QuotaValidate(next http.Handler, qv QuotaValidator) http.Handler
QuotaValidate creates handler
func RequestAsQuota ¶
RequestAsQuota creates handler
func SkipFirstQuota ¶
func SkipFirstQuota(next http.Handler, cg CountGetter) http.Handler
SkipFirstQuota creates handler
func StripPrefix ¶
StripPrefix creates handler
func ToTextAndQuota ¶
ToTextAndQuota creates handler. The handler: - extracts file from form field, - converts file to txt, - packs text as file into new request
Types ¶
type AudioLenGetter ¶
AudioLenGetter get duration
type CountGetter ¶
CountGetter get usage count from external system
type KeyValidator ¶
KeyValidator validator
Source Files ¶
- audioLenQuota.go
- cleanHeader.go
- context.go
- convertFileToTextAndQuota.go
- fillHeader.go
- fillOutHeader.go
- infoProvider.go
- ipAsKey.go
- jsonFieldExtract.go
- jsonTTSExtract.go
- keyExtract.go
- keyValid.go
- keyValidOrIP.go
- logDB.go
- logStdout.go
- proxy.go
- quota.go
- quotaJson.go
- quotaTTSJson.go
- saveValidateQuota.go
- skipFirstQuota.go
- stripPrefix.go