Documentation
¶
Index ¶
- Variables
- func Bearer(request *http.Request, origin, token string) *http.Request
- func CopyLimited(writer io.Writer, reader io.Reader, limit int64) error
- func Download(ctx context.Context, client *http.Client, location string, limit int64, ...) error
- func Get(ctx context.Context, client *http.Client, location string, limit int64) ([]byte, error)
- func PathInside(path, dir string) bool
- func ReadLimited(reader io.Reader, limit int64) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
var ErrContentTooLarge = errors.New("content exceeds the size limit")
Functions ¶
func Bearer ¶
Bearer returns a copy of request that carries token only if it goes to origin (scheme://host), redirects included.
func CopyLimited ¶
CopyLimited copies reader into writer, refusing more than limit bytes.
func Download ¶
func Download(ctx context.Context, client *http.Client, location string, limit int64, destination io.Writer) error
Download copies at most limit bytes of the 200 response to a GET of location into destination.
func PathInside ¶
PathInside reports whether path is dir or lies under it, once both have their symlinks resolved.
Types ¶
This section is empty.