datasrvstore

package
v0.0.0-...-c5655c4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2017 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	ID      int
	URL     string
	Current bool
}

Server is the in memory version of the meta information of a data server

type Store

type Store interface {
	// Add adds a new server
	Add(*Server) (*Server, error)

	// Get returns a server
	Get(id int) (*Server, error)

	// All returns all servers
	// Note: The return is expected to be sorted(ASC) by the ID
	All() ([]*Server, error)

	// SetCurrent sets the server identified by the given ID to current
	SetCurrent(id int) error

	// GetCurrent returns the server marked as current
	GetCurrent() (*Server, error)
}

Store is the interface for accessing data servers from a persisted storage

Jump to

Keyboard shortcuts

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