Documentation ¶
Index ¶
- func AddWorkerToPool(workerPool chan types.Worker)
- func CreateEmptyPool(poolSize int) chan types.Worker
- func CreatePupulatedPool(poolSize int) chan types.Worker
- func GetComponent() string
- func GetFirebaseIDToken(email, password, firebaseAPIKey string) (string, error)
- func GetSecretValue(FS embed.FS, credentialsPath string, projectID string, secretID string, ...) ([]byte, error)
- func GetWorkerFromPool(workerPool chan types.Worker) types.Worker
- func GetWorkerPoolCapacity(workerPool chan types.Worker) int
- func GetWorkerPoolSize(workerPool chan types.Worker) int
- func IsWorkerPoolEmpty(workerPool chan types.Worker) bool
- func IsWorkerPoolFull(workerPool chan types.Worker) bool
- func IsWorkerPoolFullAndNotEmpty(workerPool chan types.Worker) bool
- func IsWorkerPoolFullOrEmpty(workerPool chan types.Worker) bool
- func IsWorkerPoolNotEmpty(workerPool chan types.Worker) bool
- func IsWorkerPoolNotFull(workerPool chan types.Worker) bool
- func IsWorkerPoolNotFullAndNotEmpty(workerPool chan types.Worker) bool
- func IsWorkerPoolNotFullOrEmpty(workerPool chan types.Worker) bool
- func IsWorkerPoolNotPopulated(workerPool chan types.Worker) bool
- func IsWorkerPoolNotPopulatedAndNotEmpty(workerPool chan types.Worker) bool
- func IsWorkerPoolNotPopulatedAndNotFull(workerPool chan types.Worker) bool
- func IsWorkerPoolNotPopulatedOrEmpty(workerPool chan types.Worker) bool
- func IsWorkerPoolNotPopulatedOrFull(workerPool chan types.Worker) bool
- func IsWorkerPoolPopulated(workerPool chan types.Worker) bool
- func IsWorkerPoolPopulatedAndNotEmpty(workerPool chan types.Worker) bool
- func IsWorkerPoolPopulatedAndNotFull(workerPool chan types.Worker) bool
- func IsWorkerPoolPopulatedOrEmpty(workerPool chan types.Worker) bool
- func IsWorkerPoolPopulatedOrFull(workerPool chan types.Worker) bool
- func RemoveWorkerFromPool(workerPool chan types.Worker)
- func WriteErrorResponse(w http.ResponseWriter, msg string, errorCode int)
- func WriteGzipJSONResponse(w http.ResponseWriter, data interface{}, code int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddWorkerToPool ¶ added in v1.1.0
AddWorkerToPool is a function that adds a worker to a pool of workers.
func CreateEmptyPool ¶ added in v1.1.0
CreateEmptyPool is a function that creates a pool of workers. poolSize is the concurrency limiting factor. The returned channel is NOT populated with workers.
func CreatePupulatedPool ¶ added in v1.1.0
CreatePopulatedPool is a function that creates a pool of workers and populates it with the specified number of workers. poolSize is the concurrency limiting factor. The returned channel IS populated with workers.
func GetComponent ¶
func GetComponent() string
GetComponent returns details about the caller function. It is utilized to populate the component field of a GoogleLogEntry, or any other log entry component field.
func GetFirebaseIDToken ¶
GetFirebaseIDToken exchanges an email and password for a Firebase ID token. The email and password are used to authenticate with Firebase. The Firebase ID token is returned. If the request fails, an error is returned.
func GetSecretValue ¶ added in v1.0.8
func GetSecretValue(FS embed.FS, credentialsPath string, projectID string, secretID string, versionID string) ([]byte, error)
GetSecretValue is a function to retrieve a secret value from Google Cloud Secret Manager. FS is the embed.FS embedded filesystem to pass to the function. The credentialsPath parameter is the path to the credentials file. The projectID parameter is the ID of the Google Cloud project. The secretID parameter is the ID of the secret. The versionID parameter is the ID of the secret version. The secret value is returned as a byte slice.
func GetWorkerFromPool ¶ added in v1.1.0
GetWorkerFromPool is a function that gets a worker from a pool of workers.
func GetWorkerPoolCapacity ¶ added in v1.1.0
GetWorkerPoolCapacity is a function that gets the capacity of a pool of workers.
func GetWorkerPoolSize ¶ added in v1.1.0
GetWorkerPoolSize is a function that gets the size of a pool of workers.
func IsWorkerPoolEmpty ¶ added in v1.1.0
IsWorkerPoolEmpty is a function that checks if a pool of workers is empty.
func IsWorkerPoolFull ¶ added in v1.1.0
IsWorkerPoolFull is a function that checks if a pool of workers is full.
func IsWorkerPoolFullAndNotEmpty ¶ added in v1.1.0
IsWorkerPoolFullAndNotEmpty is a function that checks if a pool of workers is full and not empty.
func IsWorkerPoolFullOrEmpty ¶ added in v1.1.0
IsWorkerPoolFullOrEmpty is a function that checks if a pool of workers is full or empty.
func IsWorkerPoolNotEmpty ¶ added in v1.1.0
IsWorkerPoolNotEmpty is a function that checks if a pool of workers is not empty.
func IsWorkerPoolNotFull ¶ added in v1.1.0
IsWorkerPoolNotFull is a function that checks if a pool of workers is not full.
func IsWorkerPoolNotFullAndNotEmpty ¶ added in v1.1.0
IsWorkerPoolNotFullAndNotEmpty is a function that checks if a pool of workers is not full and not empty.
func IsWorkerPoolNotFullOrEmpty ¶ added in v1.1.0
IsWorkerPoolNotFullOrEmpty is a function that checks if a pool of workers is not full or empty.
func IsWorkerPoolNotPopulated ¶ added in v1.1.0
IsWorkerPoolNotPopulated is a function that checks if a pool of workers is not populated.
func IsWorkerPoolNotPopulatedAndNotEmpty ¶ added in v1.1.0
IsWorkerPoolNotPopulatedAndNotEmpty is a function that checks if a pool of workers is not populated and not empty.
func IsWorkerPoolNotPopulatedAndNotFull ¶ added in v1.1.0
IsWorkerPoolNotPopulatedAndNotFull is a function that checks if a pool of workers is not populated and not full.
func IsWorkerPoolNotPopulatedOrEmpty ¶ added in v1.1.0
IsWorkerPoolNotPopulatedOrEmpty is a function that checks if a pool of workers is not populated or empty.
func IsWorkerPoolNotPopulatedOrFull ¶ added in v1.1.0
IsWorkerPoolNotPopulatedOrFull is a function that checks if a pool of workers is not populated or full.
func IsWorkerPoolPopulated ¶ added in v1.1.0
IsWorkerPoolPopulated is a function that checks if a pool of workers is populated.
func IsWorkerPoolPopulatedAndNotEmpty ¶ added in v1.1.0
IsWorkerPoolPopulatedAndNotEmpty is a function that checks if a pool of workers is populated and not empty.
func IsWorkerPoolPopulatedAndNotFull ¶ added in v1.1.0
IsWorkerPoolPopulatedAndNotFull is a function that checks if a pool of workers is populated and not full.
func IsWorkerPoolPopulatedOrEmpty ¶ added in v1.1.0
IsWorkerPoolPopulatedOrEmpty is a function that checks if a pool of workers is populated or empty.
func IsWorkerPoolPopulatedOrFull ¶ added in v1.1.0
IsWorkerPoolPopulatedOrFull is a function that checks if a pool of workers is populated or full.
func RemoveWorkerFromPool ¶ added in v1.1.0
RemoveWorkerFromPool is a function that removes a worker from a pool of workers.
func WriteErrorResponse ¶ added in v1.0.7
func WriteErrorResponse(w http.ResponseWriter, msg string, errorCode int)
WriteErrorResponse writes an error response to the response writer with appropriate headers. It does NOT return an error because it is used to write an error response. Instead, if an error occurs internally, it writes the error to the response writer with http.Error.
func WriteGzipJSONResponse ¶
func WriteGzipJSONResponse(w http.ResponseWriter, data interface{}, code int) error
WriteGzippedJSONResponse compresses the JSON data and writes it to the response writer with appropriate headers. The Content-Encoding header is set to gzip and the Content-Type header is set to application/json. The Content-Length header is set with the length of the compressed data. The status code is set based on the provided code parameter. If the data cannot be serialized to JSON, an error is returned. If the compressed data cannot be written to the response writer, an error is returned.
Types ¶
This section is empty.