fflags

package
v0.0.0-...-7621e06 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package fflags manages Solana protocol features.

The feature mechanism coordinates the activation of (breaking) changes to the Solana protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feature

type Feature uint

Feature is an opaque handle to a feature flag.

func Register

func Register(gate solana.Address, name string) Feature

Register creates a new application-wide feature flag for the given feature gate address. Returns an opaque handle number. Idempotent, such that the same gate address can be registered twice, returning the same handle. (Useful when a feature affects two separate modules) Not thread-safe -- should be only called from the init/main goroutine.

type Features

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

Features is a set of feature flags.

func (*Features) Clone

func (s *Features) Clone() *Features

Clone creates a copy of s.

func (*Features) HasFeature

func (s *Features) HasFeature(flag Feature) bool

HasFeature returns true if the given feature flag is set.

func (*Features) WithFeature

func (s *Features) WithFeature(flag Feature) *Features

WithFeature modifies s to include the given feature flag. Returns s to support chaining-style syntax. Panics on invalid handle.

func (*Features) WithoutFeature

func (s *Features) WithoutFeature(flag uint) *Features

WithoutFeature modifies s to exclude the given feature flag. Returns s to support chaining-style syntax. Panics on invalid handle.

Jump to

Keyboard shortcuts

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