constant

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 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" // Currently unused.
	ComponentGopher            = "hostmachine"
)

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

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 for update"
	InfoFailedToRetrieveTheCurrentURL           = "Failed to retrieve the current URL for update"
	InfoOldURLDoesMatchTheCurrentURL            = "Old URL does match the current URL"
)
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.

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"
)

Define header response for different components.

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

Define header request for different components.

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.

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

Component constants for structured logging.

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