Skip to content

Use CLOS for configuration #2

@PuercoPop

Description

@PuercoPop

Just a suggestion to make easier to adapt cl-sendgrid to different deployment strategies. How sensitive information like API-keys is stored and provided to the application can vary. Environment variables and encrypted files being the most common. So having the config values be retrieved using a generic function makes it easier for the potential users of this library to configure the way they provide the api-key in a way it best suits their needs.

(defgeneric api-key (config)
  (:documentation "The Sendgrid private API key."))
(defgeneric default-sender (config)
  (:documentation "The default 'from' address."))

(defclass config ()
  ((api-key :initarg :api-key :initform (error "") :reader api-key)
   (default-sender :initarg :default-sender :reader default-sender)))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions