client

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: MIT Imports: 4 Imported by: 0

README

aerospike

Go Report Card Build Status Coverage GoDoc

Golang client wrapper for aerospike-client-go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrConfigValidation is general config validation error message.
	ErrConfigValidation = errors.New("aerospike config validation error")

	ErrEmptyHost      = fmt.Errorf("%w: host is empty", ErrConfigValidation)
	ErrEmptyPort      = fmt.Errorf("%w: port is empty", ErrConfigValidation)
	ErrEmptyNamespace = fmt.Errorf("%w: namespace is empty", ErrConfigValidation)
)

Config validation errors.

Functions

func IsErrorNotFound

func IsErrorNotFound(err error) bool

IsErrorNotFound checks error for Aerospike ErrKeyNotFound.

Types

type Client

type Client struct {
	*as.Client
	Config Config
}

Client encapsulates an Aerospike cluster. All database operations are available against this object.

func NewClient

func NewClient(cfg Config) (*Client, error)

NewClient creates connection to Aerospike and returns Aerospike Client.

type Config

type Config struct {
	Host      string `json:"host" yaml:"host"`
	Port      int    `json:"port" yaml:"port"`
	Namespace string `json:"namespace" yaml:"namespace"`
}

Config contains configuration Aerospike data.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks required fields.

Jump to

Keyboard shortcuts

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