Documentation
¶
Index ¶
- Constants
- func AccessTokenAuthHeader(token string) (string, string)
- func BasicAuth(username, password string) string
- func BasicAuthHeader(username, password string) (string, string)
- func EncodeQuery(keyAndValue map[string]interface{}) string
- func PlaceholderUrl(url string, params map[string]string) string
- func Query(keyAndValue ...interface{}) (string, error)
- func QueryUrl(url string, params map[string]string) string
- func ReplaceUrl(uri string, leftDelim string, rightDelim string, ...) string
- type HeaderBuilder
- func (b *HeaderBuilder) Build() map[string]interface{}
- func (b *HeaderBuilder) WithAccept(ct string) *HeaderBuilder
- func (b *HeaderBuilder) WithBasicAuth(username, password string) *HeaderBuilder
- func (b *HeaderBuilder) WithContentType(ct string) *HeaderBuilder
- func (b *HeaderBuilder) WithKeyValue(k, v string) *HeaderBuilder
- type UrlBuilder
Constants ¶
View Source
const ( HeaderAuthorization = "Authorization" HeaderContentType = "Content-Type" HeaderAccept = "Accept" Bearer = "bearer" )
Variables ¶
This section is empty.
Functions ¶
func AccessTokenAuthHeader ¶
func BasicAuthHeader ¶
func EncodeQuery ¶
Types ¶
type HeaderBuilder ¶
type HeaderBuilder struct {
// contains filtered or unexported fields
}
func Headers ¶
func Headers() *HeaderBuilder
func (*HeaderBuilder) Build ¶
func (b *HeaderBuilder) Build() map[string]interface{}
func (*HeaderBuilder) WithAccept ¶
func (b *HeaderBuilder) WithAccept(ct string) *HeaderBuilder
func (*HeaderBuilder) WithBasicAuth ¶
func (b *HeaderBuilder) WithBasicAuth(username, password string) *HeaderBuilder
func (*HeaderBuilder) WithContentType ¶
func (b *HeaderBuilder) WithContentType(ct string) *HeaderBuilder
func (*HeaderBuilder) WithKeyValue ¶
func (b *HeaderBuilder) WithKeyValue(k, v string) *HeaderBuilder
type UrlBuilder ¶
type UrlBuilder struct {
// contains filtered or unexported fields
}
func (*UrlBuilder) Delims ¶
func (b *UrlBuilder) Delims(leftDelim, rightDelim string) *UrlBuilder
Delims delimiters设置占位符,用于替换url的path参数
func (*UrlBuilder) PathVariable ¶
func (b *UrlBuilder) PathVariable(key string, value interface{}) *UrlBuilder
PathVariable 增加path变量参数
func (*UrlBuilder) QueryVariable ¶
func (b *UrlBuilder) QueryVariable(key string, value interface{}) *UrlBuilder
QueryVariable 增加query参数
func (*UrlBuilder) String ¶
func (b *UrlBuilder) String() string
Click to show internal directories.
Click to hide internal directories.