remote

package
v0.0.0-...-851e5e8 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UpdatePeriod              = time.Hour * 24
	RcNatTraversalMinVerKey   = "nat_traversal_min_version"
	RcTelioAnalyticsMinVerKey = "telio_analytics_min_version"
	RcFileSharingMinVerKey    = "fileshare_min_version"

	// Telio remote config has field with app version e.g. telio_config_3_16_2
	// (remote config field naming does not allow dots and dashes, only letters
	// and digits, underscores) app will try to find field corresponding to
	// app's version, but if exact match is not found then first older version
	// is chosen, if that one is also not available, then use local defaults.
	RcTelioConfigFieldPrefix = "telio_config_"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FirebaseService

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

FirebaseService is RemoteService implementation for Firebase

func NewFirebaseService

func NewFirebaseService(st string) *FirebaseService

func (*FirebaseService) FetchRemoteConfig

func (fs *FirebaseService) FetchRemoteConfig() ([]byte, error)

type RConfig

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

func NewRConfig

func NewRConfig(updatePeriod time.Duration, rs RemoteConfigService, cm config.Manager) *RConfig

NewRConfig creates instance of remote config

func (*RConfig) GetTelioConfig

func (rc *RConfig) GetTelioConfig(stringVersion string) (string, error)

GetTelioConfig try to find remote config field for app version and load json block from that field

func (*RConfig) GetValue

func (rc *RConfig) GetValue(cfgKey string) (string, error)

GetValue provides value of requested key from remote config

type RemoteConfigGetter

type RemoteConfigGetter interface {
	GetValue(key string) (string, error)
	GetTelioConfig(version string) (string, error)
}

RemoteConfigGetter get values from remote config

type RemoteConfigService

type RemoteConfigService interface {
	FetchRemoteConfig() ([]byte, error)
}

RemoteConfigService interface

type ServiceAccount

type ServiceAccount struct {
	Type                    string `json:"type"`
	ProjectID               string `json:"project_id"`
	PrivateKeyID            string `json:"private_key_id"`
	PrivateKey              string `json:"private_key"`
	ClientEmail             string `json:"client_email"`
	ClientID                string `json:"client_id"`
	AuthURI                 string `json:"auth_uri"`
	TokenURI                string `json:"token_uri"`
	AuthProviderX509CertURL string `json:"auth_provider_x509_cert_url"`
	ClientX509CertURL       string `json:"client_x509_cert_url"`
}

Jump to

Keyboard shortcuts

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