constant

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: BSD-3-Clause Imports: 0 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ComponentNoSQL             = "datastore"
	ComponentCache             = "cache" // Currently unused.
	ComponentProjectIDENV      = "projectid"
	ComponentInternalSecretENV = "customsecretkey"
	ComponentMachineOperation  = "signal_notify"
	ComponentGopher            = "hostmachine"
)

Component constants for structured logging. This is used to identify the component that is logging the message.

Note: some constants are not used in the code, indicate that for future use.

View Source
const (
	URLmismatchContextLog                       = "URL mismatch"
	URLShorteneredContextLog                    = "URL shortened and saved"
	FailedToRetriveURLContextLog                = "Failed to retrieve URL"
	FailedToUpdateURLContextLog                 = "Failed to update URL"
	FailedToDeletedURLContextLog                = "Failed to deleted URL"
	FailedToValidateURLContextLog               = "Failed to validate URL"
	FailedToGetURLContextLog                    = "Failed to get URL"
	URLnotfoundContextLog                       = "URL not found"
	IDnotfoundContextLog                        = "ID not found"
	NoURLIDContextLog                           = "No URL and ID found"
	NoURLIDDBContextLog                         = "No URL and ID found in DB"
	URLupdateContextLog                         = "URL updated successfully"
	URLdeleteContextLog                         = "URL deleted"
	URLisNilContextLog                          = "URL is nil after GetURL call"
	URLRetriveContextLog                        = "URL retrieved successfully"
	URLDeletedSuccessfullyContextLog            = "URL deleted successfully"
	ServerStartContextLog                       = "Server is starting and Listening on address"
	ServerFailContextLog                        = "Server failed to start"
	SignalContextLog                            = "Signal received"
	ServerForcetoShutdownContextLog             = "Server is forced to shutdown:"
	DataStoreFailContextLog                     = "Datastore failed to connect"
	StartupFailedContextLog                     = "Startup failed"
	StartupFailureContextLog                    = "Startup failure"
	FailedtoCloseDatastoreContextLog            = "failed to close datastore client:"
	DatastoreFailedtoCheckHealthContextLog      = "datastore client failed health check:"
	FailedToCreateDatastoreClientContextLog     = "failed to create datastore client:"
	FailedToIntializeLoggerContextLog           = "failed to initialize logger:"
	DataStoreProjectIDEnvContextLog             = "DATASTORE_PROJECT_ID environment variable not set"
	InternelSecretEnvContextLog                 = "INTERNAL_SECRET environment variable not set"
	InvalidNewURLFormatContextLog               = "Invalid new URL format"
	MisMatchBetweenPathIDandPayloadIDContextLog = "Mismatch between path ID and payload ID"
	PathIDandPayloadIDDoesnotMatchContextLog    = "Path ID and payload ID does not match"
	InfoAttemptingToRetrieveTheCurrentURL       = "Attempting to retrieve the current URL"
	InfoFailedToRetrieveTheCurrentURL           = "Failed to retrieve the current URL for update"
	InfoOldURLDoesMatchTheCurrentURL            = "Old URL does match the current URL"
)

Define header response for different components.

Note: some constants are not used in the code, indicate that for future use.

View Source
const (
	DescriptionJsonMetaData = "description"
	DetailsURLJsonMetaData  = "details_url"
)

Define JSON metadata for different components.

View Source
const (
	TimestampFormat = "2006/01/02 - 15:04:05"
	RequestDetails  = "Request Details"
)

Define log message for middleware components.

View Source
const (
	ErrorEmoji           = "❌"
	SuccessEmoji         = "✅"
	InfoEmoji            = "🛈"
	WarningEmoji         = "⚠️"
	K8sEmoji             = "☸️"
	DeployEmoji          = "🚀"
	AlertEmoji           = "🚨"
	UrlshortenerEmoji    = "🔗"
	SignalSatelliteEmoji = "📡"
	ModernGopherEmoji    = "🤖"
	GetBackEmoji         = "🔙"
	RedirectEmoji        = "🔀"
	SosEmoji             = "🆘"
	DeleteEmoji          = "🗑️"
	UpdateEmoji          = "🔄"
	NewEmoji             = "🆕"
)

Define emojis for different log levels.

Note: some constants are not used in the code, indicate that for future use.

View Source
const (
	HeaderResponseError                     = "error"
	HeaderResponseInternalServerError       = "internal server error"
	HeaderResponseshortened_url             = "shortened_url"
	HeaderResponseURlUpdated                = "URL updated successfully"
	HeaderResponseInvalidRequestJSONBinding = "Invalid request - JSON binding error"
	HeaderResponseInvalidURLFormat          = "Invalid URL format"
	HeaderResponseInvalidRequestPayload     = "Invalid request payload"
	HeaderResponseInvalidRequest            = "Invalid request"
	HeaderResponseURLDeleted                = "URL deleted successfully"
	HeaderResponseIDandURLNotFound          = "ID and URL not found"
	HeaderResponseForbidden                 = "Forbidden"
	HeaderResponseFailedtoGenerateID        = "Failed to generate ID"
	HeaderResponseFailedtoSaveURL           = "Failed to save URL"
	HeaderResponseStatus                    = "status"
	HeaderResponseRateLimitExceeded         = "Too many requests, please try again later."
)

Define header response for different components.

Note: some constants are not used in the code, indicate that for future use.

View Source
const (
	HeaderRequestOldURL = "old_url"
	HeaderRequestNewURL = "new_url"
)

Define header request for different components.

Note: some constants are not used in the code, indicate that for future use.

View Source
const (
	HeaderID              = "id"
	HeaderURL             = "url"
	HeaderMessage         = "message"
	HeaderSchemeHTTP      = "http"
	HeaderSchemeHTTPS     = "https"
	HeaderXProto          = "X-Forwarded-Proto"
	HeaderXinternalSecret = "X-Internal-Secret"
)

Define header for different components.

Note: some constants are not used in the code, indicate that for future use.

View Source
const (
	ErrorDuringDeletionContextLog = "Error during deletion"
)

Component constants for structured logging.

Note: some constants are not used in the code, indicate that for future use.

View Source
const (
	GinContextErrLog = "errorLogged"
)

Define gin context log for different components.

Note: some constants are not used in the code, indicate that for future use.

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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