utils

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const SendInterval = "10m"

SendInterval : SendInterval struct

Variables

This section is empty.

Functions

func GracefullyHandleError

func GracefullyHandleError()

GracefullyHandleError : Gracefully Handle Error

func ReadFiles

func ReadFiles(filePath string) []byte

ReadFiles reads file from the file path

func SanitizePath added in v0.2.5

func SanitizePath(_path string) string

SanitizePath : Sanitises the string path and restrict users from providing manipulated path Example :

input: ../../../etc/abc.conf
output: /etc/abc.conf

func StoreFiles

func StoreFiles(content, basePath string)

StoreFiles : Store Files

Types

type APIManager added in v0.1.1

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

APIManager : wrapper struct over core base service.

func GetAPIManagerInstance added in v0.1.1

func GetAPIManagerInstance() *APIManager

GetAPIManagerInstance : returns APIManager instance.

func (*APIManager) Request added in v0.1.1

func (ap *APIManager) Request(builder *core.RequestBuilder) (*core.DetailedResponse, error)

Request : wrapper over core base service request method.

type CollectionUsages

type CollectionUsages struct {
	CollectionID  string   `json:"collection_id"`
	EnvironmentID string   `json:"environment_id"`
	Usages        []Usages `json:"usages"`
}

CollectionUsages : CollectionUsages struct

type Metering

type Metering struct {
	CollectionID  string
	EnvironmentID string
	// contains filtered or unexported fields
}

Metering : Metering struct

func GetMeteringInstance

func GetMeteringInstance() *Metering

GetMeteringInstance : Get Metering Instance

func (*Metering) Init

func (mt *Metering) Init(guid string, environmentID string, collectionID string)

Init : Init

func (*Metering) RecordEvaluation

func (mt *Metering) RecordEvaluation(featureID string, propertyID string, entityID string, segmentID string)

RecordEvaluation : Record Evaluation

type URLBuilder added in v0.1.1

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

URLBuilder : URLBuilder struct

func GetInstance

func GetInstance() *URLBuilder

GetInstance : Get Instance

func (*URLBuilder) GetAuthenticator added in v0.1.1

func (ub *URLBuilder) GetAuthenticator() core.Authenticator

GetAuthenticator returns iam authenticator

func (*URLBuilder) GetBaseServiceURL added in v0.1.1

func (ub *URLBuilder) GetBaseServiceURL() string

GetBaseServiceURL returns base service url

func (*URLBuilder) GetToken added in v0.1.1

func (ub *URLBuilder) GetToken() string

GetToken returns the string "Bearer <token>"

func (*URLBuilder) GetWebSocketURL added in v0.1.1

func (ub *URLBuilder) GetWebSocketURL() string

GetWebSocketURL returns web socket url

func (*URLBuilder) Init added in v0.1.1

func (ub *URLBuilder) Init(collectionID string, environmentID string, region string, guid string, apikey string, overrideServiceUrl string, usePrivateEndpoint bool)

Init : Init

func (*URLBuilder) SetAuthenticator added in v0.1.1

func (ub *URLBuilder) SetAuthenticator(authenticator core.Authenticator)

SetAuthenticator : assigns an authenticator to the url builder instance authenticator member variable.

func (*URLBuilder) SetBaseServiceURL added in v0.2.5

func (ub *URLBuilder) SetBaseServiceURL(url string)

SetBaseServiceURL overrides the base service url if set

func (*URLBuilder) SetWebSocketURL added in v0.1.1

func (ub *URLBuilder) SetWebSocketURL(webSocketURL string)

SetWebSocketURL : sets web socket url

type Usages

type Usages struct {
	FeatureID      string      `json:"feature_id,omitempty"`
	PropertyID     string      `json:"property_id,omitempty"`
	EntityID       interface{} `json:"entity_id"`
	SegmentID      interface{} `json:"segment_id"`
	EvaluationTime string      `json:"evaluation_time"`
	Count          int64       `json:"count"`
}

Usages : Usages struct

Directories

Path Synopsis
*
*

Jump to

Keyboard shortcuts

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