remote

package module
v0.0.0-...-0642177 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 14 Imported by: 0

README

Firebase Remote Config Client for Go

import "github.com/NilPointer-Software/go-firebase-remote-config"

WIP

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

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

type ConditionalValues

type ConditionalValues ordered.OrderedMap[string, ParameterValue]

func (*ConditionalValues) Inner

func (*ConditionalValues) MarshalJSON

func (cv *ConditionalValues) MarshalJSON() (res []byte, err error)

func (*ConditionalValues) UnmarshalJSON

func (cv *ConditionalValues) UnmarshalJSON(data []byte) error

type Parameter

type Parameter struct {
	Description       string             `json:"description"`
	ValueType         ValueType          `json:"valueType"`
	DefaultValue      *ParameterValue    `json:"defaultValue"`
	ConditionalValues *ConditionalValues `json:"conditionalValues"`
}

func (*Parameter) Value

func (p *Parameter) Value() ParameterValue

type ParameterGroup

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

type ParameterValue

type ParameterValue struct {
	Value                *string               `json:"value"`
	UseInAppDefault      *bool                 `json:"useInAppDefault"`
	PersonalizationValue *PersonalizationValue `json:"personalizationValue"`
}

func (ParameterValue) GetValue

func (dv ParameterValue) GetValue() string

type PersonalizationValue

type PersonalizationValue struct {
	PersonalizationId string `json:"personalizationId"`
}

type RemoteConfig

type RemoteConfig struct {
	ETag            string                    `json:"-"`
	Version         Version                   `json:"version"`
	Conditions      []Condition               `json:"conditions"`
	Parameters      map[string]Parameter      `json:"parameters"`
	ParameterGroups map[string]ParameterGroup `json:"parameterGroups"`
	// contains filtered or unexported fields
}

func (*RemoteConfig) Decode

func (rc *RemoteConfig) Decode(in any) error

func (*RemoteConfig) Refresh

func (rc *RemoteConfig) Refresh() error

func (*RemoteConfig) Update

func (rc *RemoteConfig) Update() error

type RemoteConfigClient

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

func NewClient

func NewClient(ctx context.Context, opts ...option.ClientOption) (*RemoteConfigClient, error)

func (*RemoteConfigClient) Get

func (rcc *RemoteConfigClient) Get() (*RemoteConfig, error)

func (*RemoteConfigClient) ListAllVersions

func (rcc *RemoteConfigClient) ListAllVersions() ([]Version, error)

func (*RemoteConfigClient) ListVersionsByPageToken

func (rcc *RemoteConfigClient) ListVersionsByPageToken(pageToken string) (*VersionPage, error)

func (*RemoteConfigClient) Rollback

func (rcc *RemoteConfigClient) Rollback(version int64) (*RemoteConfig, error)

func (*RemoteConfigClient) Update

func (rcc *RemoteConfigClient) Update(config *RemoteConfig) (*RemoteConfig, error)

type Rollback

type Rollback struct {
	VersionNumber int64 `json:"versionNumber,string"`
}

type UpdateOrigin

type UpdateOrigin string
const (
	UpdateOriginUnspecified  UpdateOrigin = "REMOTE_CONFIG_UPDATE_ORIGIN_UNSPECIFIED"
	UpdateOriginConsole      UpdateOrigin = "CONSOLE"
	UpdateOriginRESTAPI      UpdateOrigin = "REST_API"
	UpdateOriginAdminSDKNode UpdateOrigin = "ADMIN_SDK_NODE"
)

type UpdateType

type UpdateType string
const (
	UpdateTypeUnspecified UpdateType = "REMOTE_CONFIG_UPDATE_TYPE_UNSPECIFIED"
	UpdateTypeIncremental UpdateType = "INCREMENTAL_UPDATE"
	UpdateTypeForced      UpdateType = "FORCED_UPDATE"
	UpdateTypeRollback    UpdateType = "ROLLBACK"
)

type User

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

type ValueType

type ValueType string
const (
	ValueTypeUnspecified ValueType = "PARAMETER_VALUE_TYPE_UNSPECIFIED"
	ValueTypeString      ValueType = "STRING"
	ValueTypeBoolean     ValueType = "BOOLEAN"
	ValueTypeNumber      ValueType = "NUMBER"
	ValueTypeJSON        ValueType = "JSON"
)

type Version

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

type VersionPage

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

Jump to

Keyboard shortcuts

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