server

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2013 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

This package contains all the functions specific to the server implementation and access.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator interface {
	// Generate a new password and return it.
	New() (result string, err error)
}

Password generator

func NewGenerator

func NewGenerator(source string) (result Generator, err error)

Return a generator using the given source.

type In

type In func() (io.ReadCloser, error)

Return a reader

type Key

type Key interface {
	Name() string
	Password() string
	IsDeleted() bool
	Delete()
	Encoded() string
	Merge(other Key)
	SetPassword(pass string)
}

A vault key

type MergeArgs

type MergeArgs struct {
	Vault  string
	Master string
}

Arguments to the "merge" operation.

type Out

type Out func() (io.WriteCloser, error)

Return a writer

type Server

type Server interface {
	Open(master string, reply *bool) error
	IsOpen(thenClose bool, reply *bool) error
	Get(key string, reply *string) error
	Set(args SetArgs, reply *string) error
	Unset(key string, reply *bool) error
	List(filter string, reply *[]string) error
	Merge(args MergeArgs, reply *bool) error
	Save(force bool, reply *bool) error
	Stop(status int, reply *bool) error
	Ping(info string, reply *string) error
	SetMaster(master string, reply *bool) error
}

The server interface implemented both by the actual (server-side) object and the proxy.

func Proxy

func Proxy(host string, port int, wait bool) (result Server, err error)

Return a new proxy to the Gate server identified by the host name and port.

type ServerLocal

type ServerLocal interface {
	Server() Server
	Wait() (int, error)
}

A server-side server and extra (non-exported) methods

func Start

func Start(config core.Config) (result ServerLocal, err error)

Start a server on localhost, listening on the given port

type SetArgs

type SetArgs struct {
	Key    string
	Pass   string
	Recipe string
}

Arguments to the "set" operation.

type Vault

type Vault interface {
	Open(master string, config core.Config) error
	IsOpen() bool
	Close(config core.Config) error
	Item(name string) (Key, error)
	List(filter string) ([]string, error)
	Merge(other Vault) error
	Save(force bool, config core.Config) error
	SetRandom(name string, recipe string) error
	SetPass(name string, pass string) error
	Unset(name string) error
	SetMaster(master string) error
}

The vault interface.

func NewVault

func NewVault(in In, out Out) (result Vault)

Create a new vault.

Jump to

Keyboard shortcuts

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