nock

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: Apache-2.0, MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package nock is a flags.Store backed by a SQL database through github.com/fletchhq/fletch/nock. It works on SQLite and Postgres.

Index

Constants

View Source
const Schema = `` /* 152-byte string literal not displayed */

Schema is the DDL for the Store's table. It is valid on SQLite and Postgres; copy it into an application migration or run Migrate.

View Source
const TableName = "feature_flags"

TableName is the table the Store uses.

Variables

This section is empty.

Functions

func Migrate

func Migrate(ctx context.Context, db fnock.Executor) error

Migrate creates the Store's table if it does not exist. It returns an error for a dialect other than SQLite and Postgres.

Types

type Store

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

Store implements flags.Store on a nock database.

func New

func New(db fnock.Executor) *Store

New returns a Store that runs on db, a *nock.Database or *nock.Transaction. The table must exist; see Migrate.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, flag, scope string) error

Delete implements flags.Store.

func (*Store) Get

func (s *Store) Get(ctx context.Context, flag, scope string) ([]byte, bool, error)

Get implements flags.Store.

func (*Store) List

func (s *Store) List(ctx context.Context, flag string) ([]flags.Entry, error)

List implements flags.Store.

func (*Store) Purge

func (s *Store) Purge(ctx context.Context, names ...string) error

Purge implements flags.Store.

func (*Store) Set

func (s *Store) Set(ctx context.Context, flag, scope string, value []byte) error

Set implements flags.Store.

Jump to

Keyboard shortcuts

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