dto

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 2 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertDtoToInternalFlag

func ConvertDtoToInternalFlag(dto DTO) flag.InternalFlag

ConvertDtoToInternalFlag is converting a DTO to a flag.InternalFlag.

Types

type DTO

type DTO struct {
	// TrackEvents is false if you don't want to export the data in your data exporter.
	// Default value is true
	TrackEvents *bool `json:"trackEvents,omitempty" yaml:"trackEvents,omitempty" toml:"trackEvents,omitempty"`

	// Disable is true if the flag is disabled.
	Disable *bool `json:"disable,omitempty" yaml:"disable,omitempty" toml:"disable,omitempty"`

	// Version (optional) This field contains the version of the flag.
	// The version is manually managed when you configure your flags and, it is used to display the information
	// in the notifications and data collection.
	Version *string `json:"version,omitempty" yaml:"version,omitempty" toml:"version,omitempty"`

	// Converter (optional) is the name of converter to use, if no converter specified we try to determine
	// which converter to use based on the fields we receive for the flag
	Converter *string `json:"converter,omitempty" yaml:"converter,omitempty" toml:"converter,omitempty"`

	// Variations are all the variations available for this flag. The minimum is 2 variations and, we don't have any max
	// limit except if the variationValue is a bool, the max is 2.
	Variations *map[string]*any `` //nolint:lll // struct tags (json, yaml, toml, jsonschema, mapstructure) can not be wrapped
	/* 283-byte string literal not displayed */

	// Rules is the list of Rule for this flag.
	// This an optional field.
	Rules *[]flag.Rule `` //nolint:lll // struct tags (json, yaml, toml, jsonschema, mapstructure) can not be wrapped
	/* 199-byte string literal not displayed */

	// BucketingKey defines a source for a dynamic targeting key
	BucketingKey *string `json:"bucketingKey,omitempty" yaml:"bucketingKey,omitempty" toml:"bucketingKey,omitempty"`

	// DefaultRule is the rule applied after checking that any other rules
	// matched the user.
	DefaultRule *flag.Rule `` //nolint:lll // struct tags (json, yaml, toml, jsonschema, mapstructure) can not be wrapped
	/* 220-byte string literal not displayed */

	// Scheduled is your struct to configure an update on some fields of your flag over time.
	// You can add several steps that updates the flag, this is typically used if you want to gradually add more user
	// in your flag.
	Scheduled *[]flag.ScheduledStep `` //nolint:lll // struct tags (json, yaml, toml, jsonschema, mapstructure) can not be wrapped
	/* 208-byte string literal not displayed */

	// Experimentation is your struct to configure an experimentation.
	// It will allow you to configure a start date and an end date for your flag.
	// When the experimentation is not running, the flag will serve the default value.
	Experimentation *ExperimentationDto `` //nolint:lll // struct tags (json, yaml, toml, jsonschema, mapstructure) can not be wrapped
	/* 250-byte string literal not displayed */

	// Metadata is a field containing information about your flag such as an issue tracker link, a description, etc ...
	Metadata *map[string]any `` //nolint:lll // struct tags (json, yaml, toml, jsonschema, mapstructure) can not be wrapped
	/* 215-byte string literal not displayed */
}

DTO is representing all the fields we can have in a flag. This DTO supports all flag formats and convert them into an InternalFlag using a converter.

func ConvertInternalFlagToDto

func ConvertInternalFlagToDto(f flag.InternalFlag) DTO

func (*DTO) Convert

func (d *DTO) Convert() flag.InternalFlag

Convert is converting the DTO into a flag.InternalFlag.

type ExperimentationDto

type ExperimentationDto struct {
	// Start is the starting time of the experimentation
	Start *time.Time `` //nolint:lll // struct tags (json, yaml, toml, jsonschema, mapstructure) can not be wrapped
	/* 156-byte string literal not displayed */

	// End is the ending time of the experimentation
	End *time.Time `` //nolint:lll // struct tags (json, yaml, toml, jsonschema, mapstructure) can not be wrapped
	/* 148-byte string literal not displayed */
}

Jump to

Keyboard shortcuts

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