lib

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const OUT_OF_CREDITS_MESSAGE = "out of credits"

Variables

This section is empty.

Functions

func GetCreditsClient

func GetCreditsClient(standalone bool) *redis.Client

func GetEnvVariable

func GetEnvVariable(key, defaultValue string) string

func GetEnvVariableBool added in v0.1.1

func GetEnvVariableBool(key string, defaultValue bool) bool

func GetEnvVariableRaw added in v0.1.1

func GetEnvVariableRaw(key, defaultValue string, hideError bool) string

func GetHexEnvVariable added in v0.1.1

func GetHexEnvVariable(key, defaultValue string) []byte

func IsPrivateIP

func IsPrivateIP(ip net.IP) bool

func IsPrivateIPString

func IsPrivateIPString(ip string) bool

Types

type CreditsManager

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

func CreateCreditsManager

func CreateCreditsManager(ctx context.Context, variant string, variantTargetId string,
	creditsClient *redis.Client, funcModeInfo FuncModeInfo) *CreditsManager

func (*CreditsManager) BillFinalCredits added in v0.1.4

func (creditsManager *CreditsManager) BillFinalCredits()

func (*CreditsManager) ForceDeductCredits added in v0.1.1

func (creditsManager *CreditsManager) ForceDeductCredits(credits int64, setLastBillingTime bool)

func (*CreditsManager) GetCredits

func (creditsManager *CreditsManager) GetCredits() int64

func (*CreditsManager) StartMonitoringCredits added in v0.1.4

func (creditsManager *CreditsManager) StartMonitoringCredits(outOfCreditsCallback func())

func (*CreditsManager) StopCreditsCapturing

func (creditsManager *CreditsManager) StopCreditsCapturing()

type FuncModeInfo added in v0.1.1

type FuncModeInfo struct {
	Instance100MSUnitRate int64 `json:"instance100msUnitRate"`
}

type FunctionAuthClient added in v0.1.1

type FunctionAuthClient interface {
	Functions() []LiveFunction
	ExecuteFunction(location string) (*(chan FunctionResult), error)
	CheckFunctionAvailability(location string) error
}

type FunctionResult added in v0.1.1

type FunctionResult struct {
	Response *http.Response
	Error    error
}

type JobUserUpdate

type JobUserUpdate struct {
	UpdateType string `json:"updateType"`
}

type LiveFunction added in v0.1.1

type LiveFunction struct {
	Location string
	Uri      string
	State    functionspb.Function_State
}

type WrappedJobUserUpdate

type WrappedJobUserUpdate struct {
	Update JobUserUpdate `json:"update"`
	JobId  string        `json:"jobId"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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