client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2015 License: BSD-2-Clause Imports: 19 Imported by: 1

Documentation

Overview

Package client implements the repbin client library.

Index

Constants

View Source
const PeerUpdateDuration = 259200

PeerUPdateDuration is the maximum time to wait until peer updates are forced

View Source
const Version = "0.0.1 very alpha"

Version of client functions

Variables

View Source
var (
	// ErrNoPeers is returned if the client could not find new peers
	ErrNoPeers = errors.New("client: No peers")
	// ErrNoConfig is returned when no config file could be named
	ErrNoConfig = errors.New("client: No config file")
)

Functions

func CmdDecrypt

func CmdDecrypt() int

CmdDecrypt implements decryption functions

func CmdEncrypt

func CmdEncrypt() int

CmdEncrypt encrypts data.

func CmdGenKey

func CmdGenKey() int

CmdGenKey generates a long-term public key

func CmdGenTempKey

func CmdGenTempKey() int

CmdGenTempKey generates a temporary key for a given private key

func CmdGet

func CmdGet() int

CmdGet gets a file

func CmdIndex

func CmdIndex() int

CmdIndex returns the index for a private key

func CmdPeerList

func CmdPeerList() int

CmdPeerList fetches the peerlist and returns a new configfile

func CmdPost

func CmdPost() int

CmdPost posts a message

func CmdSTM

func CmdSTM() int

CmdSTM does an STM run to specific server and from specific stmdir

func CmdShowConfig

func CmdShowConfig() int

CmdShowConfig prints current config to stdout

func KeyCallBack

func KeyCallBack(keyMgtFd int) (*os.File, func(*message.Curve25519Key) *message.Curve25519Key)

KeyCallBack implements a callback function to request keys from file-descriptor

func UserConfigFile

func UserConfigFile() string

UserConfigFile returns the path to the user's config file, or an empty string on error

func WriteConfigFile

func WriteConfigFile(conf ConfigVariables) error

WriteConfigFile writes the user's config file

Types

type ConfigVariables

type ConfigVariables struct {
	BodyLength    int
	PadToLength   int
	MinHashCash   byte
	PrivateKey    string
	KeyDir        string   // directory for signKeys
	SocksServer   string   // url of socks server (if any)
	PeerUpdate    int64    // when did we update the peers last?
	BootStrapPeer string   // What peer to bootstrap from
	PasteServers  []string // urls of pastebins
}

ConfigVariables are settings read from config file

var GlobalConfigVar ConfigVariables

GobalconfigVar

func LoadConfigFile

func LoadConfigFile(file string) (conf ConfigVariables, err error)

LoadConfigFile loads configuration from a file

type Options

type Options struct {
	KEYVERB bool // switch on key verbosity
	Verbose bool // switch on verbosity
	Appdata bool // switch on appdata output

	Sync   bool // key is synced
	Hidden bool // key is hidden

	Privkey string // private key

	Signkey string // signature key file
	Signdir string // signature directory

	Configfile string // load configuration from file

	Infile  string // read input data from file
	Outfile string // write output data to file
	Stmdir  string // STM dir
	Outdir  string // output directory for batch index download

	Senderkey    string // public key for recipient
	Recipientkey string // public key for recipient
	Embedkey     bool   // embed a new/fresh public key
	Notrace      bool   // embed keys do not depend on private key
	Anonymous    bool   // disable private key and previous signerkeys
	Repost       bool   // create a repost message (will not be posted)
	Mindelay     int    // minimum repost delay
	Maxdelay     int    // maximum repost delay

	Keymgt int // key management file descriptor

	Start int // start position for index fetch
	Count int // maximum number of index entries to fetch

	Socksserver string // socks server to use
	Server      string // server to use

	MessageType int // message type of message
}

Options are options used in the client

var OptionsVar Options

OptionsVar .

Jump to

Keyboard shortcuts

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