Documentation ¶
Overview ¶
Package playerindices indexes player attributes in Redis for faster filtering of player pools.
Copyright 2018 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
https://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.
Index ¶
- Variables
- func Create(ctx context.Context, rPool *redis.Pool, cfg *viper.Viper, ...) error
- func Delete(ctx context.Context, rPool *redis.Pool, cfg *viper.Viper, playerID string) error
- func DeleteMeta(ctx context.Context, rPool *redis.Pool, playerID string)
- func Retrieve(cfg *viper.Viper) (indices []string, err error)
- func RetrievePrevious(cfg *viper.Viper) []string
- func Touch(ctx context.Context, rPool *redis.Pool, playerID string) error
Constants ¶
This section is empty.
Variables ¶
var ( // OM Internal metadata indices MetaIndices = []string{ "OM_METADATA.created", "OM_METADATA.accessed", } )
Functions ¶
func Create ¶
func Create(ctx context.Context, rPool *redis.Pool, cfg *viper.Viper, player om_messages.Player) error
Create indices for given player attributes in Redis. TODO: make this quit and not index the player if the context is cancelled.
func Delete ¶
Delete a player's indices without deleting their JSON object representation from state storage. Note: In Open Match, it is best practice to 'lazily' remove indices by running this as a goroutine. TODO: make this quit cleanly if the context is cancelled.
func DeleteMeta ¶
DeleteMeta removes a player's internal Open Match metadata indices, and should only be used after deleting their JSON object representation from state storage. Note: In Open Match, it is best practice to 'lazily' remove indices by running this as a goroutine. TODO: make this quit cleanly if the context is cancelled.
func RetrievePrevious ¶
RetrievePrevious attempts to handle an edge case when the user has removed an index from the list of player indices but players still exist who are indexed using the (now no longer used) index. The user should put the index they are no longer using into this config parameter so that deleting players with previous indexes doesn't result in a Redis memory leak. In a future version, Open Match should track previous indices itself and handle this for the user.
Types ¶
This section is empty.