protocol

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 0 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.

README

Protocol Custom

Protocol custom header, all Key start with Protocol or Internal, like ProtocolRequestIDKey = "X-Request-ID"

Generate protocol code

$ go generate ./...

ProtocolRequestIDKey

Set request id

ProtocolForceStoreMemory

force store in memory

ProtocolCacheStatusKey

Response cache status with name, like X-Cache: HIT from memory

ProtocolPrefetchCacheKey

Prefetch cache, value 1 mean prefetch, 0 mean not prefetch

ProtocolPrefetchCacheTime

Set force Cache-Control Cache time, value is seconds, like CacheTime: 60 mean Cache-Control: max-age=60

InternalTraceKey

Internal trace key, value is 1 or 0, 1 mean enable trace, 0 mean disable trace

InternalStoreUrl

Set force store-url, value is string, like http://example.com/somepath/app.apk

InternalSwapfile

Show response swapfile info, debug now!

InternalFillRangePercent

Set fill range percent, value is int, like InternalFillRangePercent: 50 mean fill 50% of response

InternalCacheErrCode

Set force cache error code, value is int, like InternalCacheErrCode: 1 mean force cache errcode like > 400

InternalUpstreamAddr

Dynamic set upstream addr, value is string, like InternalUpstreamAddr: [IP_ADDRESS]

Documentation

Overview

Code generated by go generate; DO NOT EDIT.

Index

Constants

View Source
const (
	FlagOn  = "1" // gateway control flag ON
	FlagOff = "0" // gateway control flag OFF
)

flag constants

View Source
const (
	ProtocolRequestIDKey     = "X-Request-ID"
	ProtocolCacheStatusKey   = "X-Cache"
	ProtocolForceStoreMemory = "X-FS-Mem"
	ProtocolPrefetchCacheKey = "X-Prefetch"
	ProtocolCacheTime        = "X-CacheTime"
	InternalTraceKey         = "i-xtrace"
	InternalStoreUrl         = "i-x-store-url"
	InternalSwapfile         = "i-x-swapfile"
	InternalFillRangePercent = "i-x-fp"
	InternalCacheErrCode     = "i-x-ct-code"
	InternalUpstreamAddr     = "i-x-ups-addr"
)

与网关交互的常量定义表

View Source
const AppName = "tavern"

Variables

This section is empty.

Functions

This section is empty.

Types

type Protocol

type Protocol string

Jump to

Keyboard shortcuts

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