Help us shape the future of Go! Take the 2026 Go Developer Survey

memorydb

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package memorydb emulates Amazon MemoryDB over JSON 1.1. Clusters run as one-node Valkey (or Redis) clusters in Docker, and the users of their ACL are put in the server with ACL SETUSER; subnet groups, parameter groups, snapshots and tags are metadata. Without Docker the API still answers. ponytail: TLS is recorded, not served; IAM users exist but cannot sign in (ElastiCache's token proxy is not wired here).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	Name, Status         string
	UserNames            []string
	MinimumEngineVersion string
	Clusters             []string `json:",omitempty"`
	ARN                  string
}

ACL is an access control list: users a cluster lets in.

type Cluster

type Cluster struct {
	Name, Description, Status                  string
	NumberOfShards                             int
	Shards                                     []Shard `json:",omitempty"`
	AvailabilityMode                           string
	ClusterEndpoint                            *rds.Endpoint `json:",omitempty"`
	NodeType, Engine, EngineVersion            string
	EnginePatchVersion                         string
	ParameterGroupName, ParameterGroupStatus   string
	SecurityGroups                             []SecurityGroupMembership `json:",omitempty"`
	SubnetGroupName                            string
	TLSEnabled                                 bool
	KmsKeyId                                   string `json:",omitempty"`
	ARN                                        string
	SnsTopicArn                                string `json:",omitempty"`
	SnsTopicStatus                             string `json:",omitempty"`
	SnapshotRetentionLimit                     int
	MaintenanceWindow, SnapshotWindow, ACLName string
	AutoMinorVersionUpgrade                    bool
	DataTiering, NetworkType, IpDiscovery      string
}

Cluster is a MemoryDB cluster.

type EngineVersion

type EngineVersion struct{ Engine, EngineVersion, EnginePatchVersion, ParameterGroupFamily string }

EngineVersion is an engine version pogi offers.

type Node

type Node struct {
	Name, Status, AvailabilityZone string
	CreateTime                     core.Time
	Endpoint                       *rds.Endpoint `json:",omitempty"`
}

Node is a node of a shard.

type Parameter

type Parameter struct{ Name, Value, Description, DataType, AllowedValues, MinimumEngineVersion string }

Parameter is a parameter of a parameter group.

type ParameterGroup

type ParameterGroup struct {
	Name, Family, Description, ARN string
	Params                         map[string]string `json:"params,omitempty"` // pogi's: values set
}

ParameterGroup is a parameter group.

type SecurityGroupMembership

type SecurityGroupMembership struct{ SecurityGroupId, Status string }

SecurityGroupMembership is a security group of a cluster.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is the MemoryDB emulator.

func New

func New(hub *core.Hub) *Service

New creates the MemoryDB service.

func (*Service) Close

func (s *Service) Close() error

Close removes the containers, except those persisted state resumes next run.

func (*Service) Info

func (s *Service) Info() core.Info

func (*Service) Inspect

func (s *Service) Inspect(table, id string) any

Inspect returns a cluster with pogi's side: container, state, pogiNote.

func (*Service) Load

func (s *Service) Load(b []byte) error

Load restores state and reconnects to the containers by name; those of dropped clusters go.

func (*Service) Reset

func (s *Service) Reset()

func (*Service) Resources

func (s *Service) Resources() []core.Table

Resources lists clusters, users and ACLs for the console.

func (*Service) Save

func (s *Service) Save() ([]byte, error)

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Shard

type Shard struct {
	Name, Status, Slots string
	Nodes               []Node
	NumberOfNodes       int
}

Shard is a shard of a cluster; all nodes share the cluster's one server.

type Snapshot

type Snapshot struct {
	Name, Status, Source string
	KmsKeyId             string `json:",omitempty"`
	ARN                  string
	ClusterConfiguration struct {
		Name, Description, NodeType, Engine, EngineVersion, MaintenanceWindow string
		TopicArn                                                              string `json:",omitempty"`
		Port                                                                  int
		ParameterGroupName, SubnetGroupName, VpcId                            string
		SnapshotRetentionLimit                                                int
		SnapshotWindow                                                        string
		NumShards                                                             int
	}
	DataTiering string
}

Snapshot is a snapshot of a cluster. ponytail: metadata only; restoring one makes an empty cluster.

type Subnet

type Subnet struct {
	Identifier            string
	AvailabilityZone      struct{ Name string }
	SupportedNetworkTypes []string
}

Subnet is a subnet of a subnet group.

type SubnetGroup

type SubnetGroup struct {
	Name, Description, VpcId string
	Subnets                  []Subnet
	ARN                      string
	SupportedNetworkTypes    []string
}

SubnetGroup is a subnet group.

type User

type User struct {
	Name, Status, AccessString string
	ACLNames                   []string
	MinimumEngineVersion       string
	Authentication             struct {
		Type          string
		PasswordCount int `json:",omitempty"`
	}
	ARN string
}

User is a MemoryDB user.

Jump to

Keyboard shortcuts

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