Documentation
¶
Index ¶
- Constants
- func ActionFileCheck(conf ActionFile) error
- func ReqHostSet(req *bfe_basic.Request, hostname string)
- func ReqHostSetFromFirstPathSegment(req *bfe_basic.Request)
- func ReqHostSuffixReplace(req *bfe_basic.Request, originSuffix, newSuffix string)
- func ReqPathPrefixAdd(req *bfe_basic.Request, prefix string)
- func ReqPathPrefixTrim(req *bfe_basic.Request, prefix string)
- func ReqPathSet(req *bfe_basic.Request, path string)
- func ReqQueryAdd(req *bfe_basic.Request, params []string)
- func ReqQueryDel(req *bfe_basic.Request, keys []string)
- func ReqQueryDelAllExcept(req *bfe_basic.Request, keys []string)
- func ReqQueryRename(req *bfe_basic.Request, oldName string, newName string)
- type Action
- type ActionFile
Constants ¶
View Source
const ( // connection actions ActionClose = "CLOSE" // close, close the connection directly ActionPass = "PASS" // pass, do nothing ActionFinish = "FINISH" // finish, close connection after reply // header actions ActionReqHeaderAdd = "REQ_HEADER_ADD" // add request header ActionReqHeaderSet = "REQ_HEADER_SET" // set request header ActionReqHeaderDel = "REQ_HEADER_DEL" // del request header // host actions ActionHostSetFromPathPrefix = "HOST_SET_FROM_PATH_PREFIX" // set host from path prefix ActionHostSet = "HOST_SET" // set host ActionHostSuffixReplace = "HOST_SUFFIX_REPLACE" // set host replaced suffx // path actions ActionPathSet = "PATH_SET" // set path ActionPathPrefixAdd = "PATH_PREFIX_ADD" // add path prefix ActionPathPrefixTrim = "PATH_PREFIX_TRIM" // trim path prefix // query actions ActionQueryAdd = "QUERY_ADD" // add query ActionQueryDel = "QUERY_DEL" // del query ActionQueryRename = "QUERY_RENAME" // rename query ActionQueryDelAllExcept = "QUERY_DEL_ALL_EXCEPT" // del query except given query key )
View Source
const HeaderPrefix = "X-BFE-"
Variables ¶
This section is empty.
Functions ¶
func ActionFileCheck ¶
func ActionFileCheck(conf ActionFile) error
func ReqHostSet ¶
ReqHostSet sets hostname to request.
func ReqHostSetFromFirstPathSegment ¶
ReqHostSetFromFirstPathSegment set hostname from first path segment.
example: if uri path pattern is /x.baidu.com/xxxx,
set host x.baidu.com set uri path /xxx
if do not match this pattern, do noting
func ReqHostSuffixReplace ¶
ReqHostSuffixReplace replaces suffix of hostname.
func ReqPathPrefixAdd ¶
ReqPathPrefixAdd adds prefix to path. e.g., path "/(.*)" => "/link?$1",
func ReqPathPrefixTrim ¶
ReqPathPrefixTrim trims prefix of path e.g., path "/service/shortcut/(.*)" => "/$1",
func ReqPathSet ¶
ReqPathSet sets path to request.
func ReqQueryAdd ¶
ReqQueryAdd adds some number of (key, value) to query.
func ReqQueryDel ¶
ReqQueryDel deletes some keys from query
func ReqQueryDelAllExcept ¶
ReqQueryDelAllExcept deletes all keys from query, except some keys
Types ¶
type Action ¶
func (*Action) UnmarshalJSON ¶
UnmarshalJSON decodes given data in json format
type ActionFile ¶
Click to show internal directories.
Click to hide internal directories.