util

package
v0.0.0-...-1bf7cb7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package util contains random junk, for internal use only. Thus I'm willing to use a grab-back naming scheme, until something better pops up

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttPath

func AttPath(o *kouch.Options) string

AttPath calculates the server path to an attachment.

func ChttpDo

func ChttpDo(ctx context.Context, method, path string, o *kouch.Options) error

ChttpDo performs an HTTP request (GET is downgraded to HEAD if body is nil), writing the header to head, and body to body. If either head or body is nil, that write is skipped.

func CommonOptions

func CommonOptions(ctx context.Context, scope kouch.TargetScope, flags *pflag.FlagSet) (*kouch.Options, error)

CommonOptions parses options common to most or all commands.

func CopyAll

func CopyAll(dst io.Writer, src io.Reader) error

CopyAll copies from src to dst, and checks for any errors on close. If dst is nil, src is simply closed.

func DatabasePath

func DatabasePath(o *kouch.Options) string

DatabasePath calculates the server path to a database.

func DocPath

func DocPath(o *kouch.Options) string

DocPath calculates the server path to a document

func FetchRev

func FetchRev(ctx context.Context, o *kouch.Options) (string, error)

FetchRev fetches the document revision from the server

func NopWriteCloser

func NopWriteCloser(w io.Writer) io.WriteCloser

NopWriteCloser turns an io.Writer into an io.WriteCloser, with a noop Close() method.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL