remoteconfig

package
v4.8.4 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Blue       = "BLUE"
	Brown      = "BROWN"
	Cyan       = "CYAN"
	DeepOrange = "DEEPORANGE"
	Green      = "GREEN"
	Indigo     = "INDIGO"
	Lime       = "LIME"
	Orange     = "ORANGE"
	Pink       = "PINK"
	Purple     = "PURPLE"
	Teal       = "TEAL"
)

Tag colors

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client .

func NewClient

func NewClient(ctx context.Context, c *internal.RemoteConfig) (*Client, error)

NewClient returns the default remote config

func (*Client) ForcePublishTemplate

func (c *Client) ForcePublishTemplate(ctx context.Context, template *Template) (*Template, error)

ForcePublishTemplate will publish the template irrespective of the outcome from validations

func (*Client) GetTemplate

func (c *Client) GetTemplate(ctx context.Context) (*Template, error)

GetTemplate will retrieve the latest template

func (*Client) GetTemplateAtVersion

func (c *Client) GetTemplateAtVersion(ctx context.Context, versionNumber string) (*Template, error)

GetTemplateAtVersion will retrieve the specified version of the template

func (*Client) PublishTemplate

func (c *Client) PublishTemplate(ctx context.Context, template Template, validateOnly bool) (*Template, error)

PublishTemplate will publish the specified template

func (*Client) Rollback

func (c *Client) Rollback(ctx context.Context, versionNumber string) (*Template, error)

Rollback will perform a rollback operation on the template https://firebase.google.com/docs/reference/remote-config/rest/v1/projects.remoteConfig/rollback

func (*Client) UpdateRemoteConfig

func (c *Client) UpdateRemoteConfig(eTag string, validateOnly bool) (*Response, error)

UpdateRemoteConfig https://firebase.google.com/docs/reference/remote-config/rest/v1/projects/updateRemoteConfig

func (*Client) ValidateTemplate

func (c *Client) ValidateTemplate(ctx context.Context, template *Template) (*Template, error)

ValidateTemplate will run validations for the current template

func (*Client) Versions

func (c *Client) Versions(ctx context.Context, options *ListVersionsOptions) (*VersionIterator, error)

Versions will list the versions of the template

type Condition

type Condition struct {
	Expression string   `json:"expression"`
	Name       string   `json:"name"`
	TagColor   TagColor `json:"tagColor"`
}

Condition targets a specific group of users A list of these conditions make up part of a Remote Config template

type ListVersionsOptions

type ListVersionsOptions struct {
	StartTime        time.Time
	EndTime          time.Time
	EndVersionNumber string
	PageSize         int
	PageToken        string
}

ListVersionsOptions to be used as query params in the request to list versions

type ListVersionsResponse

type ListVersionsResponse struct {
	NextPageToken string    `json:"nextPageToken"`
	Versions      []Version `json:"versions"`
}

ListVersionsResponse is a list of Remote Config template versions

type Parameter

type Parameter struct {
	ConditionalValues map[string]*ParameterValue `json:"conditionalValues"`
	DefaultValue      *ParameterValue            `json:"defaultValue"`
	Description       string                     `json:"description"`
}

Parameter .

type ParameterGroup

type ParameterGroup struct {
	Description string                `json:"description"`
	Parameters  map[string]*Parameter `json:"parameters"`
}

ParameterGroup representing a Remote Config parameter group Grouping parameters is only for management purposes and does not affect client-side fetching of parameter values

type ParameterValue

type ParameterValue struct {
	ExplicitValue   string `json:"value"`
	UseInAppDefault bool   `json:"useInAppDefault,omitempty"`
}

ParameterValue .

func NewExplicitParameterValue

func NewExplicitParameterValue(value string) *ParameterValue

NewExplicitParameterValue will add a new explicit parameter value

func UseInAppDefaultValue

func UseInAppDefaultValue() *ParameterValue

UseInAppDefaultValue returns a parameter value with the in app default as false

type RemoteConfig

type RemoteConfig struct {
	Conditions      []Condition               `json:"conditions"`
	Parameters      map[string]Parameter      `json:"parameters"`
	Version         Version                   `json:"version"`
	ParameterGroups map[string]ParameterGroup `json:"parameterGroups"`
}

RemoteConfig represents a Remote Config

func (*RemoteConfig) Bytes added in v4.8.1

func (t *RemoteConfig) Bytes() ([]byte, error)

func (*RemoteConfig) Mime added in v4.8.1

func (t *RemoteConfig) Mime() string

type Response

type Response struct {
	*RemoteConfig
	Etag string `json:"etag"`
}

Response to save the API response including ETag

type TagColor

type TagColor string

TagColor represents a tag color

type Template

type Template struct {
	Conditions      []Condition
	ETag            string
	Parameters      map[string]Parameter
	ParameterGroups map[string]ParameterGroup
	Version         Version
}

Template .

type User

type User struct {
	Email    string `json:"email"`
	ImageURL string `json:"imageUrl"`
	Name     string `json:"name"`
}

User represents a remote config user

type Version

type Version struct {
	Description    string    `json:"description"`
	IsLegacy       bool      `json:"isLegacy"`
	RollbackSource int64     `json:"rollbackSource"`
	UpdateOrigin   string    `json:"updateOrigin"`
	UpdateTime     time.Time `json:"updateTime"`
	UpdateType     string    `json:"updateType"`
	UpdateUser     *User     `json:"updateUser"`
	VersionNumber  int64     `json:"versionNumber,string"`
}

Version a Remote Config template version. Output only, except for the version description. Contains metadata about a particular version of the Remote Config template. All fields are set at the time the specified Remote Config template is published. A version's description field may be specified in PublishTemplate calls

type VersionIterator

type VersionIterator struct{}

VersionIterator represents the iterator for looping over versions

func (*VersionIterator) Next

func (it *VersionIterator) Next() (*Version, error)

Next will return the next version item in the loop

func (*VersionIterator) PageInfo

func (it *VersionIterator) PageInfo() *iterator.PageInfo

PageInfo represents the information about a Page

Jump to

Keyboard shortcuts

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