flagstore

package
v0.0.0-...-d9a74f6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: Apache-2.0, MIT Imports: 2 Imported by: 4

Documentation

Overview

Interface for storing "flags", a form of private automod metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlagStore

type FlagStore interface {
	Get(ctx context.Context, key string) ([]string, error)
	Add(ctx context.Context, key string, flags []string) error
	Remove(ctx context.Context, key string, flags []string) error
}

type MemFlagStore

type MemFlagStore struct {
	Data map[string][]string
}

func NewMemFlagStore

func NewMemFlagStore() MemFlagStore

func (MemFlagStore) Add

func (s MemFlagStore) Add(ctx context.Context, key string, flags []string) error

func (MemFlagStore) Get

func (s MemFlagStore) Get(ctx context.Context, key string) ([]string, error)

func (MemFlagStore) Remove

func (s MemFlagStore) Remove(ctx context.Context, key string, flags []string) error

does not error if flags not in set

type RedisFlagStore

type RedisFlagStore struct {
	Client *redis.Client
}

func NewRedisFlagStore

func NewRedisFlagStore(redisURL string) (*RedisFlagStore, error)

func (*RedisFlagStore) Add

func (s *RedisFlagStore) Add(ctx context.Context, key string, flags []string) error

func (*RedisFlagStore) Get

func (s *RedisFlagStore) Get(ctx context.Context, key string) ([]string, error)

func (*RedisFlagStore) Remove

func (s *RedisFlagStore) Remove(ctx context.Context, key string, flags []string) error

Jump to

Keyboard shortcuts

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