redisReplicator

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2024 Google LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

redisReplicator is an implementation of open match state storage replication using Redis Streams as the mechanism. https://redis.io/docs/latest/develop/data-types/streams/

If you're thinking about updating how data is stored in Redis by editing this file:

  • All updates should be modelled as a single redis command that adds one item to the stream. Each addition to the stream gets its own entry ID from redis, meaning every update has a unique entry ID, which simplifies replication significantly. Although putting multiple key/value pairs modelling multiple updates into one stream addition is possible, it isn't accounted for in this design and shouldn't be used.
  • There is a memoryReplicator as well, that aims to reproduce this redisReplicator's behavior in local memory. If you change anything here, you'll likely need to update that file too.

Index

Constants

This section is empty.

Variables

View Source
var (
	NoTicketKeyErr  = errors.New("Missing ticket key")
	NoTicketDataErr = errors.New("No ticket data")
	NoAssignmentErr = errors.New("Missing assignment")
	InvalidInputErr = errors.New("Invalid input")
)

Functions

func New

func New(cfg *viper.Viper) (*redisReplicator, error)

errors returned by inline functions aren't seen by our code and we can't print them or use them to make decisions. They are just used by the imported module internals to decide if connections need to be retried/closed, so disable this linting check.

Types

This section is empty.

Jump to

Keyboard shortcuts

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