cache

package
v0.0.0-...-93b8736 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: 0BSD Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheTimeout time.Duration = 15 * time.Minute
View Source
var ClientTimeout = 100 * time.Millisecond

Functions

func Serve

func Serve() error

Serve launches a new RPC password server and blocks until the server automatically shuts itself down via the timeout() function.

Types

type CacheClient

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

func NewClient

func NewClient() (*CacheClient, error)

NewClient returns an initialized RPC client.

func (*CacheClient) Close

func (client *CacheClient) Close()

Close calls the underlying net/rpc.Client's Close() method.

func (*CacheClient) GetPass

func (client *CacheClient) GetPass(filename, cachepass, token string) (string, error)

GetPass attempts to fetch a cached password from the server.

func (*CacheClient) IsCached

func (client *CacheClient) IsCached(filename string) bool

IsCached checks if the server has a cache entry for the specified filename.

func (*CacheClient) SetPass

func (client *CacheClient) SetPass(filename, masterpass, cachepass string) error

SetPass attempts to cache a password to the server.

type CacheEntry

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

type CacheServer

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

func (*CacheServer) GetPass

func (server *CacheServer) GetPass(data GetPassData, password *string) error

GetPass method exposed by the RPC server.

func (*CacheServer) IsCached

func (server *CacheServer) IsCached(data IsCachedData, result *bool) error

Contains method exposed by the RPC server.

func (*CacheServer) SetPass

func (server *CacheServer) SetPass(data SetPassData, notused *bool) error

SetPass method exposed by the RPC server.

type GetPassData

type GetPassData struct {
	Filename  string
	CachePass string
	Token     string
}

type IsCachedData

type IsCachedData struct {
	Filename string
}

type SetPassData

type SetPassData struct {
	Filename   string
	MasterPass string
	CachePass  string
}

Jump to

Keyboard shortcuts

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