messages

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrVaultNotFound is used when a vault could not be found in the provider.
	ErrVaultNotFound = edvError("specified vault does not exist")
	// ErrDocumentNotFound is used when a document could not be found in a vault.
	ErrDocumentNotFound = edvError("specified document does not exist")
	// ErrDuplicateVault is used when an attempt is made to create a vault under a name that is already being used.
	ErrDuplicateVault = edvError("vault already exists")
	// ErrDuplicateDocument is used when an attempt is made to create a document with an ID that is already being used.
	ErrDuplicateDocument = edvError("a document with the given ID already exists")
	// ErrNotBase58Encoded is the error returned by the EDV server when an attempt is made
	// to create a document with an ID that is not a base58-encoded value (which is required by the EDV spec).
	ErrNotBase58Encoded = edvError("document ID must be a base58-encoded value")
	// ErrNot128BitValue is the error returned by the EDV server when an attempt is made
	// to create a document with an ID that is base58-encoded, but the original value was not 128 bits long
	// (which is required by the EDV spec).
	ErrNot128BitValue = edvError("document ID is base58-encoded, but original value before encoding was not 128 bits long")

	// FailWriteResponse is logged when a ResponseWriter fails to write.
	FailWriteResponse = " Failed to write response back to sender: %s."

	// DebugLogEvent is used for logging debugging events.
	DebugLogEvent = `
Event: %s`
	// DebugLogEventWithReceivedData is used for logging debugging events with received data.
	DebugLogEventWithReceivedData = DebugLogEvent + `
Received data: %s`

	// CreateVaultFailReadRequestBody is used when the incoming request body can't be read..
	// This should not happen during normal operation.
	CreateVaultFailReadRequestBody = "Received request to create a new data vault, " +
		"but failed to read the request body: %s."
	// InvalidVaultConfig is used when a received data vault configuration is invalid.
	InvalidVaultConfig = "Received invalid data vault configuration: %s."
	// BlankReferenceID is the message returned by the EDV server when an attempt is made to create a vault
	// with a blank reference ID.
	BlankReferenceID = "referenceId can't be blank"
	// VaultCreationFailure is used when an error prevents a new data vault from being created.
	VaultCreationFailure = "Failed to create a new data vault: %s."
	// MarshalVaultConfigForLogFailure is used when the log level is set to debug and a data vault configuration
	// fails to marshal back into bytes for logging purposes.
	MarshalVaultConfigForLogFailure = "Failed to marshal vault config back into bytes for logging purposes: %s."

	// QueryReceiveRequest is used for logging new queries.
	QueryReceiveRequest = "Received request to query data vault %s."
	// QueryFailReadRequestBody is used when the incoming request body can't be read.
	// This should not happen during normal operation.
	QueryFailReadRequestBody = QueryReceiveRequest + " Failed to read the request body: %s."
	// InvalidQuery is used when an invalid query is received.
	InvalidQuery = `Received invalid query for data vault %s: %s.`
	// QueryFailure is used when an error occurs while querying a vault.
	QueryFailure = `Failure while querying vault %s: %s.`
	// QuerySuccess is used when a vault is successfully queried.
	QuerySuccess = `Successfully queried data vault %s.`
	// QueryNoMatchingDocs is used when a query returns no matching documents.
	QueryNoMatchingDocs = QuerySuccess + " No matching documents were found."
	// FailToMarshalDocIDs is used when the document IDs returned from a query can't be marshalled.
	// This should not happen during normal operation.
	FailToMarshalDocIDs = QuerySuccess + " Failed to marshal the matching document IDs into bytes: %s."
	// MarshalQueryForLogFailure is used when the log level is set to debug and a query
	// fails to marshal back into bytes for logging purposes.
	MarshalQueryForLogFailure = "Failed to marshal query back into bytes for logging purposes: %s."

	// CreateDocumentReceiveRequest is used for logging create document requests.
	CreateDocumentReceiveRequest = "Received request to create a new document in data vault %s."
	// CreateDocumentFailReadRequestBody is used when the incoming request body can't be read.
	// This should not happen during normal operation.
	CreateDocumentFailReadRequestBody = CreateDocumentReceiveRequest +
		` Failed to read request body: %s.`
	// InvalidDocument is used when an invalid document is received.
	InvalidDocument = `Received a request to create a document in vault %s, ` +
		"but the document is invalid: %s."
	// CreateDocumentFailure is used when an error occurs while creating a new document.
	CreateDocumentFailure = `Failure while creating document in vault %s: %s.`
	// CreateDocumentSuccess is used when a document is successfully created.
	CreateDocumentSuccess = "Successfully created a new document document in vault %s at %s."
	// MarshalDocumentForLogFailure is used when the log level is set to debug and a document
	// fails to marshal back into bytes for logging purposes.
	MarshalDocumentForLogFailure = "Failed to marshal document back into bytes for logging purposes: %s."

	// ReadAllDocumentsReceiveRequest is used for logging read all documents requests.
	ReadAllDocumentsReceiveRequest = "Received request to read all documents from data vault %s."
	// ReadAllDocumentsFailure is used when an error occurs while reading all documents.
	ReadAllDocumentsFailure = `Failed to read all documents in vault %s: %s.`
	// ReadAllDocumentsSuccess is used when all documents are successfully read.
	ReadAllDocumentsSuccess = "Successfully retrieved all documents in vault %s."
	// ReadAllDocumentsSuccessWithRetrievedDocs is used when all request documents are successfully read.
	// Includes the content of the retrieved documents.
	ReadAllDocumentsSuccessWithRetrievedDocs = "Successfully retrieved all documents in vault %s. " +
		"Retrieved docs: %s"
	// FailToMarshalAllDocuments is used when the returned array of documents fails to marshal.
	// This should not happen during normal operation.
	FailToMarshalAllDocuments = ReadAllDocumentsSuccess + " Failed to marshal the documents: %s"

	// ReadDocumentReceiveRequest is used for logging read document requests.
	ReadDocumentReceiveRequest = "Received request to read document %s from data vault %s."
	// ReadDocumentFailure is used when an error occurs while reading a document.
	ReadDocumentFailure = `Failed to read document %s in vault %s: %s.`
	// ReadDocumentSuccess is used when a request document is successfully read.
	ReadDocumentSuccess = "Successfully retrieved document %s in vault %s."
	// ReadDocumentSuccessWithRetrievedDoc is used when a request document is successfully read.
	// Includes the retrieved document contents.
	ReadDocumentSuccessWithRetrievedDoc = "Successfully retrieved document %s in vault %s. Retrieved doc: %s"

	// PutLogSpecFailReadRequestBody is used when the incoming request body can't be read.
	// This should not happen during normal operation.
	PutLogSpecFailReadRequestBody = "Received request to change the log spec, " +
		"but failed to read the request body: %s."
	// InvalidLogSpec is used when a request is made to change the current log specification
	// but it is in an invalid format.
	InvalidLogSpec = `Invalid log spec. It needs to be in the following format: ` +
		`ModuleName1=Level1:ModuleName2=Level2:ModuleNameN=LevelN:AllOtherModuleDefaultLevel
Valid log levels: critical,error,warn,info,debug
Error: %s`
	// SetLogSpecSuccess is used when the current log specification is successfully changed.
	SetLogSpecSuccess = "Successfully set log level(s)."
	// MultipleDefaultValues is used when an incoming log spec defines multiple default values, which is invalid.
	MultipleDefaultValues = "multiple default values found"

	// GetLogSpecSuccess is used when the current log specification is successfully retrieved.
	GetLogSpecSuccess = "Successfully got log level(s)."
	// GetLogSpecPrepareErrMsg is used when an error occurs while preparing the
	// list of current log levels for the sender. This should not happen during normal operation.
	GetLogSpecPrepareErrMsg = "Failure while preparing log level response: %s."

	// UnescapeFailure is used when an error occurs while unescaping a path variable
	UnescapeFailure = "Unable to unescape %s path variable: %s."

	// FailWhileGetAllDocsFromStoreErrMsg is used when there's a failure while getting all documents from an
	// underlying store
	FailWhileGetAllDocsFromStoreErrMsg = "failure while getting all documents from store: %w"
)

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