enabled

package
v1.31.3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Enabled_name = map[int32]string{
		0: "DEFAULT",
		1: "ENABLE",
		2: "DISABLE",
	}
	Enabled_value = map[string]int32{
		"DEFAULT": 0,
		"ENABLE":  1,
		"DISABLE": 2,
	}
)

Enum value maps for Enabled.

Functions

This section is empty.

Types

type Enabled

type Enabled int32

Enabled is a three-way boolean: default, enable, disable.

const (
	// DEFAULT defaults to the default option.
	Enabled_DEFAULT Enabled = 0
	// ENABLE enables the option even if it would normally be false.
	Enabled_ENABLE Enabled = 1
	// DISABLE disables the option even if it would normally be true.
	Enabled_DISABLE Enabled = 2
)

func (Enabled) Enum

func (x Enabled) Enum() *Enabled

func (Enabled) IsEnabled

func (x Enabled) IsEnabled(defaultValue bool) bool

IsEnabled returns whether the option is enabled, given the default value.

func (Enabled) MarshalJSON

func (x Enabled) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Enabled to JSON.

func (Enabled) MarshalProtoJSON

func (x Enabled) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Enabled to JSON.

func (Enabled) MarshalProtoText

func (x Enabled) MarshalProtoText() string

func (Enabled) MarshalText

func (x Enabled) MarshalText() ([]byte, error)

MarshalText marshals the Enabled to text.

func (Enabled) Merge

func (x Enabled) Merge(y Enabled) Enabled

Merge merges y into x overriding x if y is not set to DEFAULT.

func (Enabled) String

func (x Enabled) String() string

func (*Enabled) UnmarshalJSON

func (x *Enabled) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Enabled from JSON.

func (*Enabled) UnmarshalProtoJSON

func (x *Enabled) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Enabled from JSON.

func (*Enabled) UnmarshalText

func (x *Enabled) UnmarshalText(b []byte) error

UnmarshalText unmarshals the Enabled from text.

func (Enabled) Validate

func (x Enabled) Validate() error

Validate returns an error if the Enabled value is invalid.

Jump to

Keyboard shortcuts

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