gobind

package
v0.0.0-...-5076e5b Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package gobind provides experimental Go bindings for a simplified Upspin Client and related data structures in such a way that languages such as Java and Objective-C can handle and gomobile can export. Currently, gomobile cannot export slices other than byte, so slices are converted to linked lists when necessary. Unsigned types are not supported either, so they're converted to their signed equivalents and truncations or roundings are silently ignored. This package is experimental and is NOT an official upspin.Client implementation. Its definition may change or break without warning.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a wrapped upspin.Client.

func NewClient

func NewClient(clientConfig *ClientConfig) (*Client, error)

NewClient returns a new Client for a given user's configuration.

func (*Client) Get

func (c *Client) Get(path string) ([]byte, error)

Get returns the contents of a path.

func (*Client) Glob

func (c *Client) Glob(pattern string) (*DirEntry, error)

Glob returns a linked list of DirEntry listing the results of the Glob operation.

func (*Client) Put

func (c *Client) Put(name string, data []byte) (string, error)

Put puts the data as the contents of name and returns its reference in the default location (at the default store).

type ClientConfig

type ClientConfig struct {
	// UserName is the upspin.UserName.
	UserName string

	// PublicKey is the user's upspin.PublicKey.
	PublicKey string

	// PrivateKey is the user's private key.
	PrivateKey string

	// KeyNetAddr is the upspin.NetAddr of an upspin.Remote KeyServer endpoint.
	KeyNetAddr string

	// StoreNetAddr is the upspin.NetAddr of an upspin.Remote StoreServer endpoint.
	StoreNetAddr string

	// DirNetAddr is the upspin.NetAddr of an upspin.Remote DirServer endpoint.
	DirNetAddr string
}

ClientConfig is a setup data structure that configures the Client for a given user with keys and server endpoints.

func NewClientConfig

func NewClientConfig() *ClientConfig

NewClientConfig returns a new ClientConfig.

type DirEntry

type DirEntry struct {
	Name         string
	IsDir        bool
	Size         int64
	LastModified int64
	Writer       string
	Next         *DirEntry
}

DirEntry represents the most relevant pieces of an upspin.DirEntry for clients.

Jump to

Keyboard shortcuts

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