server

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package server contains utilities for serving a principal using a socket-based IPC system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPrincipal

func LoadPrincipal(credentials string, create bool) (security.Principal, error)

LoadPrincipal returns the principal persisted in the given credentials directory. If the private key is encrypted, it prompts for a decryption passphrase. If the principal doesn't exist and create is true, it creates the principal.

Types

type IPCState

type IPCState interface {
	// Close shuts the IPC system down.
	Close()
	// IdleStartTime returns the time when the IPC system became idle (no
	// connections).  Returns the zero time instant if connections exits.
	IdleStartTime() time.Time
	// NumConnections returns the number of current connections.
	NumConnections() int
}

IPCState represents the IPC system serving the principal.

func Serve

func Serve(p security.Principal, socketPath string) (IPCState, error)

Serve serves the given principal using the given socket file, and returns an IPCState for the service.

Jump to

Keyboard shortcuts

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