guardrpc

package
v0.0.0-...-30b4a77 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2016 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package guardrpc implements calls from client -> server for token operations.

Index

Constants

This section is empty.

Variables

View Source
var DefaultClientFactory = jsonclient.New

DefaultClientFactory is the default factory for new clients

View Source
var (
	// ErrParams is returned if a call returned bad parameters
	ErrParams = errors.New("guardrpc: bad RPC parameters")
)
View Source
var ServiceURL = constants.IssuerURL

ServiceURL is the URL template for issuers. Notice the leading dot and trailing slash

Functions

This section is empty.

Types

type RPCclient

type RPCclient struct {
	ClientFactory      func(string, []byte) (*jsonclient.URLClient, error)
	ServiceGuardCA     []byte   // The CA of the serviceguard, if any
	URL                *url.URL // The serviceguard URL template
	AuthUser, AuthPass string   // For optional authentication
}

RPCclient encapsulates a service-guard RPC client

func New

func New(cacert []byte) (*RPCclient, error)

New returns a new RPCclient

func (RPCclient) GetParams

func (rpc RPCclient) GetParams(pubKey *[ed25519.PublicKeySize]byte) ([]byte, error)

GetParams returns params from a service-guard identified by pubKey

func (RPCclient) GetParamsInternal

func (rpc RPCclient) GetParamsInternal(pubKey *[ed25519.PublicKeySize]byte) ([]byte, error)

GetParamsInternal returns params from a service-guard identified by pubKey

func (RPCclient) Issue

func (rpc RPCclient) Issue(pubKey, owner *[ed25519.PublicKeySize]byte) ([]byte, []byte, error)

Issue calls issue on the serviceguard

func (RPCclient) Reissue

func (rpc RPCclient) Reissue(pubKey *[ed25519.PublicKeySize]byte, packet []byte) ([]byte, []byte, error)

Reissue calls reissue on the serviceguard

func (RPCclient) Spend

func (rpc RPCclient) Spend(pubKey *[ed25519.PublicKeySize]byte, packet []byte) (bool, error)

Spend calls spend on the serviceguard

Jump to

Keyboard shortcuts

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