Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Host(path string) string
- func (c *Client) Hosts(index int) string
- func (c *Client) Path(imgPath string) string
- func (c *Client) PathWithParams(imgPath string, params url.Values) string
- func (c *Client) Scheme() string
- func (c *Client) Secure() bool
- func (c *Client) ShardStrategy() ShardStrategy
- func (c *Client) SignatureForPath(path string) string
- func (c *Client) SignatureForPathAndParams(path string, params url.Values) string
- type ShardStrategy
Constants ¶
View Source
const ( ShardStrategyCRC = ShardStrategy(":crc") ShardStrategyCycle = ShardStrategy(":cycle") )
Variables ¶
View Source
var RegexUrlCharactersToEscape = regexp.MustCompile("([^ a-zA-Z0-9_.-])")
Regexp for all characters we should escape in a URI passed in.
View Source
var RegexpHTTPAndS = regexp.MustCompile("https?://")
Matches http:// and https://
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
The Client is used to build URLs.
func NewClientWithToken ¶
Create a new Client with the given host and token. HTTPS enabled.
func (*Client) PathWithParams ¶
`PathWithParams` will manually build a URL from a given path string and parameters passed in. Because of the differences in how net/url escapes path components, we need to manually build a URL as best we can.
The behavior of this function is highly dependent upon its test suite.
func (*Client) ShardStrategy ¶
func (c *Client) ShardStrategy() ShardStrategy
The sharding strategy used by this client. Panics if the sharding strategy is not supported by this library.
func (*Client) SignatureForPath ¶
Creates and returns the URL signature in the form of "s=SIGNATURE" with no values.
type ShardStrategy ¶
type ShardStrategy string
Click to show internal directories.
Click to hide internal directories.