store

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2016 License: Apache-2.0 Imports: 9 Imported by: 25

Documentation

Index

Constants

View Source
const PackageName = "store"

PackageName is the name of this package.

Variables

View Source
var (
	// AerospikeFromConsulFlag indicates whether Consul should be used to get
	// an Aerospike client.
	AerospikeFromConsulFlag = config.DeclareBool(
		PackageName, "aerospikeFromConsul")
	// AerospikeFixedAddrFlag indicates a fixed address which is used if
	// AerospikeFromConsulFlag is false.
	AerospikeFixedAddrFlag = config.DeclareString(
		PackageName, "aerospikeFixedAddr", "leverosaerospike:3000")
)

Functions

func DeleteEnv

func DeleteEnv(as *aerospike.Client, env string) error

DeleteEnv removes an env.

func EnvExists

func EnvExists(as *aerospike.Client, env string) (exists bool, err error)

EnvExists returns true iff the env exists.

func InitServiceTable

func InitServiceTable(as *aerospike.Client) error

InitServiceTable initializes the indices for the service table.

func NewAerospike

func NewAerospike() (as *aerospike.Client, err error)

NewAerospike returns a new Aerospike client.

func NewEnv

func NewEnv(as *aerospike.Client, env string, description string) error

NewEnv stores a new env.

func NewService

func NewService(
	as *aerospike.Client, env string, service string,
	description string, isPublic bool) error

NewService stores a new service.

func NewServiceCodeVersion

func NewServiceCodeVersion(
	as *aerospike.Client, env string, service string) (
	newVersion int64, err error)

NewServiceCodeVersion generates a version number of the code and returns it.

func ServiceExists

func ServiceExists(
	as *aerospike.Client, env string, service string) (
	exists bool, err error)

ServiceExists returns true iff the service exists.

func ServiceServingData

func ServiceServingData(
	as *aerospike.Client, env string, service string) (
	servingID string, liveVersion int64, isPublic bool, err error)

ServiceServingData retrieves information about how to serve the code for this service.

Note: This function is used on the hot path of RPC serving.

func SetServiceLiveCodeVersion

func SetServiceLiveCodeVersion(
	as *aerospike.Client, env string, service string, version int64) (
	err error)

SetServiceLiveCodeVersion sets the provided version of the code as the live one.

func UpdateService

func UpdateService(
	as *aerospike.Client, env string, service string, description string,
	isPublic bool, liveCodeVersion int64) (
	err error)

UpdateService updates the data associated with a service.

Types

type EnvData

type EnvData struct {
	Description string `as:"Description"`
}

EnvData is the data associated with the env and stored in the database.

type ServiceData

type ServiceData struct {
	Env             string `as:"Env"`
	UniqueID        string `as:"ID"`
	Description     string `as:"Desc"`
	NextCodeVersion int64  `as:"NextVer"`
	LiveCodeVersion int64  `as:"LiveVer"`
	IsPublic        bool   `as:"IsPub"`
}

ServiceData is the data associated with the service and stored in the database.

Jump to

Keyboard shortcuts

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