v0.0.1 Latest Latest

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

Go to latest
Published: Nov 2, 2020 License: MPL-2.0 Imports: 6 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type AuthMechanism

type AuthMechanism interface {
	// contains filtered or unexported methods

type Client

type Client struct {
	// contains filtered or unexported fields

func NewClient

func NewClient(baseUrl string, userAgent string, authMechanism AuthMechanism) (*Client, error)

TODO: Validate baseUrl?

func (*Client) CreateFeatureFlag

func (c *Client) CreateFeatureFlag(feature Feature) error

func (*Client) DeleteFeatureFlag

func (c *Client) DeleteFeatureFlag(name string) error

func (*Client) FeatureFlagByName

func (c *Client) FeatureFlagByName(featureName string) (*Feature, error)

func (*Client) ListFeatureFlags

func (c *Client) ListFeatureFlags() ([]Feature, error)

func (*Client) UpdateFeatureFlag

func (c *Client) UpdateFeatureFlag(name string, feature Feature) error

type Constraint

type Constraint struct {
	ContextName string   `json:"contextName"`
	Operator    Operator `json:"operator"`
	Values      []string `json:"values"`

Constraint represents a constraint on a particular context value.

type Feature

type Feature struct {
	Name        string       `json:"name"`
	Description string       `json:"description"`
	Enabled     bool         `json:"enabled"`
	Strategies  []Strategy   `json:"strategies"`
	CreatedAt   time.Time    `json:"createdAt"`
	Strategy    string       `json:"strategy"`
	Parameters  ParameterMap `json:"parameters"`

type FeatureResponse

type FeatureResponse struct {
	Features []Feature `json:"features"`

func (FeatureResponse) FeatureMap

func (fr FeatureResponse) FeatureMap() map[string]interface{}

type Operator

type Operator string

Operator is a type representing a constraint operator

const (
	// OperatorIn indicates that the context values must be
	// contained within those specified in the constraint.
	OperatorIn Operator = "IN"

	// OperatorNotIn indicates that the context values must
	// NOT be contained within those specified in the constraint.
	OperatorNotIn Operator = "NOT_IN"

type ParameterDescription

type ParameterDescription struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Description string `json:"description"`
	Required    bool   `json:"required"`

type ParameterMap

type ParameterMap map[string]interface{}

type Response

type Response struct {
	Version int `json:"version"`

type Strategy

type Strategy struct {
	Id          int          `json:"id"`
	Name        string       `json:"name"`
	Constraints []Constraint `json:"constraints"`
	Parameters  ParameterMap `json:"parameters"`

type StrategyDescription

type StrategyDescription struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Parameters  []ParameterDescription `json:"parameters"`

type StrategyResponse

type StrategyResponse struct {
	Strategies []StrategyDescription `json:"strategies"`

type UnsecureAuthentication

type UnsecureAuthentication struct {
	Email    string
	Username string

Jump to

Keyboard shortcuts

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