cache

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 cache caches the key server capabilities and clients used for mutecrypt's cryptengine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

A Cache caches key server capabilities and clients used for mutecrypt's cryptengine.

func New

func New() *Cache

New returns a new cache.

func (*Cache) Get

func (c *Cache) Get(
	domain, port, altHost, homedir, requiredMethod string,
) (*jsonclient.URLClient, *capabilities.Capabilities, error)

Get returns the cached JSON-RPC client and capabilities for the given domain and makes sure that the requiredMethod is supported. If no client has been cached, the cache is filled using the Set method with the given domain, port, altHost, and homedir parameters.

func (*Cache) Set

func (c *Cache) Set(domain, port, altHost, homedir string) error

Set requests capabilities information from key server at the given domain and port and caches the used JSON-RPC client and the resulting capabilities. If altHost is defined, it is used as the alternate hostname for the given domain name. homedir is used to load key server certificates.

func (*Cache) ShowCapabilities

func (c *Cache) ShowCapabilities(domain, port, altHost, homedir string) error

ShowCapabilities shows the cached capabilities of the key server at domain on stdout. If no capabilities have been cached, the cache is filled using the Set method with the given domain, port, altHost, and homedir parameters.

Jump to

Keyboard shortcuts

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