utils

package
v0.0.0-...-84c3780 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENV                                  = "ENVIRONMENT"
	DEV                                  = "DEVELOPMENT"
	PROD                                 = "PRODUCTION"
	TEST                                 = "TESTING"
	FEATURE_FLAG_TABLE_NAME              = "featureFlag"
	FEATURE_FLAG_USER_MAPPING_TABLE_NAME = "featureFlagUserMapping"
	ENABLED                              = "ENABLED"
	DISABLED                             = "DISABLED"
	Id                                   = "id"
	Name                                 = "name"
	Description                          = "description"
	CreatedAt                            = "createdAt"
	CreatedBy                            = "createdBy"
	Status                               = "status"
	UpdatedBy                            = "updatedBy"
	UpdatedAt                            = "updatedAt"
	UserId                               = "userId"
	FlagId                               = "flagId"
	ConcurrencyDisablingLambda           = 0
)

Variables

This section is empty.

Functions

func CheckRequestAllowed

func CheckRequestAllowed(db *dynamodb.DynamoDB, concurrencyValue int)

func ClientError

func ClientError(statusCode int, body string) (events.APIGatewayProxyResponse, error)

func DdbError

func DdbError(err error)

func ServerError

func ServerError(err error) (events.APIGatewayProxyResponse, error)

func SetUpEnv

func SetUpEnv()

func ValidateFeatureFlagStatus

func ValidateFeatureFlagStatus(status string) bool

Types

type CreateFeatureFlagRequest

type CreateFeatureFlagRequest struct {
	FlagName    string `json:"name" validate:"required"`
	Description string `json:"description" validate:"required"`
	UserId      string `json:"userId" validate:"required"`
}

type CreateFeatureFlagUserMappingRequest

type CreateFeatureFlagUserMappingRequest struct {
	Status string `json:"status" validate:"required"`
	UserId string `json:"userId" validate:"required"`
}

type FeatureFlagResponse

type FeatureFlagResponse struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Status      string `json:"status"`
	CreatedAt   int64  `json:"createdAt"`
	CreatedBy   string `json:"createdBy"`
	UpdatedAt   int64  `json:"updatedAt"`
	UpdatedBy   string `json:"updatedBy"`
}

type FeatureFlagUserMappingResponse

type FeatureFlagUserMappingResponse struct {
	UserId    string `json:"userId"`
	FlagId    string `json:"flagId"`
	Status    string `json:"status"`
	CreatedAt int64  `json:"createdAt"`
	CreatedBy string `json:"createdBy"`
	UpdatedAt int64  `json:"updatedAt"`
	UpdatedBy string `json:"updatedBy"`
}

type UpdateFeatureFlagRequest

type UpdateFeatureFlagRequest struct {
	Status string `json:"status" validate:"required"`
	UserId string `json:"userId" validate:"required"`
}

type UpdateFeatureFlagUserMappingRequest

type UpdateFeatureFlagUserMappingRequest struct {
	Status string `json:"status" validate:"required"`
	UserId string `json:"userId" validate:"required"`
}

Jump to

Keyboard shortcuts

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