Documentation ¶
Index ¶
- func HexEscape(s string, shouldEscape func(s []rune, i int) bool) string
- func HexUnescape(s string) string
- func OpenBucketV2(ctx context.Context, client *s3v2.Client, bucketName string, opts *Options) (*blob.Bucket, error)
- func URLEscape(s string) string
- func URLUnescape(s string) string
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HexEscape ¶
HexEscape returns s, with all runes for which shouldEscape returns true escaped to "__0xXXX__", where XXX is the hex representation of the rune value. For example, " " would escape to "__0x20__".
Non-UTF-8 strings will have their non-UTF-8 characters escaped to unicode.ReplacementChar; the original value is lost. Please file an issue if you need non-UTF8 support.
Note: shouldEscape takes the whole string as a slice of runes and an index. Passing it a single byte or a single rune doesn't provide enough context for some escape decisions; for example, the caller might want to escape the second "/" in "//" but not the first one. We pass a slice of runes instead of the string or a slice of bytes because some decisions will be made on a rune basis (e.g., encode all non-ASCII runes).
func OpenBucketV2 ¶
func OpenBucketV2(ctx context.Context, client *s3v2.Client, bucketName string, opts *Options) (*blob.Bucket, error)
OpenBucketV2 returns a *blob.Bucket backed by S3, using AWS SDK v2.
func URLUnescape ¶
URLUnescape reverses URLEscape using url.PathUnescape. If the unescape returns an error, it returns s.