manipulate: go.aporeto.io/manipulate/manipmemory Index | Files

package manipmemory

import "go.aporeto.io/manipulate/manipmemory"

Package manipmemory provides a go-memdb backed Manipulator.

This is meant to be use to communicate with Bahamut based API servers.

Index

Package Files

doc.go manipulator.go options.go schema.go utils.go

func New Uses

func New(c map[string]*IdentitySchema, options ...Option) (manipulate.TransactionalManipulator, error)

New creates a new datastore backed by a memdb.

type IdentitySchema Uses

type IdentitySchema struct {
    // Identity of the object.
    Identity elemental.Identity

    // Indexes of the object
    Indexes []*Index
}

IdentitySchema is the configuration of the indexes for the associated identity.

type Index Uses

type Index struct {

    // Name of the index. Must match an attribute of elemental.
    Name string

    // Type of the index.
    Type IndexType

    // If there is a unique requirement on the index. At least
    // one of the indexes must have this set.
    Unique bool

    // Attribute is the elemental attribute name.
    Attribute string
}

Index configures the attributes that must be indexed.

type IndexType Uses

type IndexType int

IndexType is the data type of the index.

const (
    IndexTypeString IndexType = iota
    IndexTypeSlice
    IndexTypeMap
    IndexTypeBoolean
    IndexTypeStringBased
)

Values of IndexType.

type Option Uses

type Option func(*config)

An Option represents a maniphttp.Manipulator option.

func OptionNoCopy Uses

func OptionNoCopy(noCopy bool) Option

OptionNoCopy tells the manipulator to store the data as is without copying it. This is faster, but unsafe as pointers are stored as is, allowing random modifications. If you use this option, you must make sure you are not modifying the object your store or retrieve.

Package manipmemory imports 10 packages (graph). Updated 2019-08-16. Refresh now. Tools for package owners.