httpclient

package module
v0.0.0-...-a9ac1ba Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(l Logger)

SetLogger sets package log

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client ...

func NewClient

func NewClient(url string) *Client

NewClient creates a Client for an HTTP API.

func (*Client) Deliver

func (c *Client) Deliver(id keyup.ID, msg []byte, recipients []keyup.ID) error

Deliver ...

func (*Client) Messages

func (c *Client) Messages(userKey *keyup.UserKey, version string) (*api.MessagesResponse, error)

Messages ...

func (*Client) PutSigchainStatement

func (c *Client) PutSigchainStatement(st *keyup.Statement) error

PutSigchainStatement ...

func (*Client) PutUserPublicKey

func (c *Client) PutUserPublicKey(upk *keyup.UserPublicKey) error

PutUserPublicKey ...

func (*Client) SetHTTPClient

func (c *Client) SetHTTPClient(httpClient *http.Client)

SetHTTPClient sets the http.Client to use.

func (*Client) SetTimeNow

func (c *Client) SetTimeNow(nowFn func() time.Time)

SetTimeNow sets the clock Now fn.

func (*Client) Sigchain

func (c *Client) Sigchain(upk *keyup.UserPublicKey) (*api.SigchainResponse, error)

Sigchain ...

func (*Client) Sigchains

func (c *Client) Sigchains(version string) (*api.SigchainsResponse, error)

Sigchains ...

func (*Client) URI

func (c *Client) URI() string

URI ...

func (*Client) UserPublicKey

func (c *Client) UserPublicKey(pkid keyup.ID) (*api.UserPublicKeyResponse, error)

UserPublicKey ...

func (*Client) UserPublicKeys

func (c *Client) UserPublicKeys(version string) (*api.UserPublicKeysResponse, error)

UserPublicKeys ...

func (*Client) Users

func (c *Client) Users(query string, index int, limit int) (*api.UsersResponse, error)

Users ...

type LogLevel

type LogLevel int

LogLevel ...

const (
	// DebugLevel ...
	DebugLevel LogLevel = 3
	// InfoLevel ...
	InfoLevel LogLevel = 2
	// WarnLevel ...
	WarnLevel LogLevel = 1
	// ErrLevel ...
	ErrLevel LogLevel = 0
)

type Logger

type Logger interface {
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warningf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
}

Logger interface used in this package

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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