model

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHealthPK added in v1.7.1

func BuildHealthPK() string

BuildHealthPK returns the fully-formed DynamoDB partition key for health status records. Exported so that gateway code uses the same key construction as model internals.

func BuildHealthSK added in v1.7.1

func BuildHealthSK(instanceId string) string

BuildHealthSK returns the fully-formed DynamoDB sort key for a given instanceId. Exported so that gateway code uses the same key construction as model internals.

func ConnectDataStore

func ConnectDataStore(cfg *config.Config) error

func DeleteInstanceHealthFromDataStore added in v1.0.8

func DeleteInstanceHealthFromDataStore(instanceKeys ...*dynamodb.DynamoDBTableKeyValue) (deleteFailKeys []*dynamodb.DynamoDBTableKeyValue, err error)

func DeleteServerRouteFromDataStore

func DeleteServerRouteFromDataStore(serverKey string) error

func GetDynamoDBActionRetryAttempts added in v1.7.0

func GetDynamoDBActionRetryAttempts() uint

GetDynamoDBActionRetryAttempts returns the configured retry attempts value

func GetGatewayKey added in v1.7.0

func GetGatewayKey() string

GetGatewayKey returns the configured gateway key

func GetHashKey added in v1.7.1

func GetHashKey(name string) (secret string, found bool)

GetHashKey returns the hash secret for a given key name, and whether it was found

func GetHashKeys added in v1.7.0

func GetHashKeys() map[string]string

GetHashKeys returns a copy of the hash keys map

func GetHashKeysCount added in v1.7.1

func GetHashKeysCount() int

GetHashKeysCount returns the number of hash keys configured

func GetHealthReportCleanUpFrequencySeconds added in v1.7.0

func GetHealthReportCleanUpFrequencySeconds() uint

GetHealthReportCleanUpFrequencySeconds returns the configured cleanup frequency

func GetHealthReportRecordStaleMinutes added in v1.7.0

func GetHealthReportRecordStaleMinutes() uint

GetHealthReportRecordStaleMinutes returns the configured stale minutes value

func GetInstanceHealthFromDataStore added in v1.0.8

func GetInstanceHealthFromDataStore(instanceId string) (lastHealthy string, err error)

func GetServerRouteFromDataStore

func GetServerRouteFromDataStore(serverKey string) (serverUrl string, err error)

func GetServiceDiscoveryTimeoutSeconds added in v1.7.0

func GetServiceDiscoveryTimeoutSeconds() uint

GetServiceDiscoveryTimeoutSeconds returns the configured timeout value

func SetDynamoDBActionRetryAttempts added in v1.7.0

func SetDynamoDBActionRetryAttempts(v uint)

SetDynamoDBActionRetryAttempts sets the retry attempts value

func SetGatewayKey added in v1.7.0

func SetGatewayKey(v string)

SetGatewayKey sets the gateway key

func SetHashKeys added in v1.7.0

func SetHashKeys(v map[string]string)

SetHashKeys sets the hash keys map

func SetHealthReportCleanUpFrequencySeconds added in v1.7.0

func SetHealthReportCleanUpFrequencySeconds(v uint)

SetHealthReportCleanUpFrequencySeconds sets the cleanup frequency

func SetHealthReportRecordStaleMinutes added in v1.7.0

func SetHealthReportRecordStaleMinutes(v uint)

SetHealthReportRecordStaleMinutes sets the stale minutes value

func SetInstanceHealthToDataStore added in v1.0.8

func SetInstanceHealthToDataStore(namespaceId string, serviceId string, instanceId string, awsRegion string, serviceInfo string, hostInfo string) (err error)

func SetServiceDiscoveryTimeoutSeconds added in v1.7.0

func SetServiceDiscoveryTimeoutSeconds(v uint)

SetServiceDiscoveryTimeoutSeconds sets the timeout value

Types

type HealthStatus added in v1.7.1

type HealthStatus struct {
	PK             string `json:"pk" dynamodbav:"PK"`
	SK             string `json:"sk" dynamodbav:"SK"`
	NamespaceId    string `json:"namespaceid" dynamodbav:"NamespaceId"`
	ServiceId      string `json:"serviceid" dynamodbav:"ServiceId"`
	InstanceId     string `json:"instanceid" dynamodbav:"InstanceId"`
	AwsRegion      string `json:"awsregion" dynamodbav:"AWSRegion"`
	ServiceInfo    string `json:"serviceinfo" dynamodbav:"ServiceInfo"`
	HostInfo       string `json:"hostinfo" dynamodbav:"HostInfo"`
	LastTimestamp  int64  `json:"lasttimestamp" dynamodbav:"LastTimestamp"`
	LastUpdatedUTC string `json:"lastupdatedutc" dynamodbav:"LastUpdatedUTC"`
}

HealthStatus represents a service instance health record in DynamoDB

func ListInactiveInstancesFromDataStore added in v1.0.8

func ListInactiveInstancesFromDataStore() (inactiveInstances []*HealthStatus, err error)

Jump to

Keyboard shortcuts

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