Documentation

Overview

    Package global contains constants, test variables, and some minor utility functions.

    global is not intended for use by code outside of go-credentials and should only be used with internal code inside of the go-credentials library.

    Index

    Constants

    View Source
    const DEFAULT_PROFILE_NAME = "default"
    View Source
    const ERR_KEY_MUST_MATCH_REGEX = "sorry the key must only include letters and underscores [0-9A-Za-z_]"
    View Source
    const ERR_NOT_YET_IMPLEMENTED = "this feature has not yet been implemented"
    View Source
    const INDENT_JSON = "    "
    View Source
    const LOG_LEVEL_ENVIRONMENT_KEY = "GO_CREDS_LOG_LEVEL"
    View Source
    const LOG_OUTPUT_TYPE_ENV_KEY = "GO_CREDS_LOG_OUTPUT_TYPE"
    View Source
    const NO_SECTION_KEY = "DEFAULT"
    View Source
    const OUTPUT_TYPE_ENV = "env"
    View Source
    const OUTPUT_TYPE_INI = "ini"
    View Source
    const OUTPUT_TYPE_INVALID = "nri"
    View Source
    const OUTPUT_TYPE_JSON = "json"
    View Source
    const PASSWORD_LABEL = "password"
    View Source
    const REGEX_KEY_NAME = "(?m)^[0-9A-Za-z_]+$"
    View Source
    const SECTION_NAME_BLANK = "__SECTION_NAME_BLANK__"
    View Source
    const TEST_VAR_APPLICATION_NAME = "mtca" // my_test_credential_application
    

      Test Labels

      These are used as labels when indexing maps within tests.

      View Source
      const TEST_VAR_ATTRIBUTE_NAME_LABEL = "a_test_attribute"
      View Source
      const TEST_VAR_ATTRIBUTE_VALUE = "a global attribute value"
      View Source
      const TEST_VAR_BAD_ATTRIBUTE_NAME = "a_ /test_attribute"
      View Source
      const TEST_VAR_BAD_KEY_LABEL = "bad section key label"
      View Source
      const TEST_VAR_BAD_PROFILE_LABEL = "this is a bad profile name"
      View Source
      const TEST_VAR_BAD_SECTION_KEY = "bad section key"
      View Source
      const TEST_VAR_DUPLICATE_KEY_LABEL = "duplicate_key"
      View Source
      const TEST_VAR_DUPLICATE_KEY_VALUE = "duplicate key value"
      View Source
      const TEST_VAR_ENVIRONMENT_APPLICATION_NAME = "MTCA"

        Test Environment Labels

        These are used as labels when accessing environment variables within tests.

        View Source
        const TEST_VAR_ENVIRONMENT_ATTRIBUTE_NAME_LABEL = "MTCA::DEFAULT::ATTRIBUTE::FIRST_SECTION::A_TEST_ATTRIBUTE"
        View Source
        const TEST_VAR_ENVIRONMENT_BAD_LABEL = "bad key with no underscores"
        View Source
        const TEST_VAR_ENVIRONMENT_PASSWORD_ALTERNATE_LABEL = "MTCA::DEFAULT::SECRET_KEY"
        View Source
        const TEST_VAR_ENVIRONMENT_PASSWORD_LABEL = "MTCA::DEFAULT::PASSWORD"
        View Source
        const TEST_VAR_ENVIRONMENT_USERNAME_ALTERNATE_LABEL = "MTCA::DEFAULT::ACCESS_TOKEN"
        View Source
        const TEST_VAR_ENVIRONMENT_USERNAME_LABEL = "MTCA::DEFAULT::USERNAME"
        View Source
        const TEST_VAR_FIRST_PROFILE_LABEL = "first_profile"
        View Source
        const TEST_VAR_FIRST_SECTION_KEY = "first_section"

          Variables for Profiles

          These are the values that were introduced for building profiles.

          View Source
          const TEST_VAR_FIRST_SECTION_UNIQUE_KEY_LABEL = "first_section_key"
          View Source
          const TEST_VAR_FIRST_SECTION_UNIQUE_KEY_VALUE = "first section unique value"
          View Source
          const TEST_VAR_NO_SECTION_UNIQUE_KEY_LABEL = "no_section_key"
          View Source
          const TEST_VAR_NO_SECTION_UNIQUE_KEY_VALUE = "no section unique value"
          View Source
          const TEST_VAR_PASSWORD = "as=/sle\\sowkjg@!"
          View Source
          const TEST_VAR_PASSWORD_ALTERNATE = ".YaJ5XAA${hh8^C"
          View Source
          const TEST_VAR_PASSWORD_ALTERNATE_LABEL = "secret_key"
          View Source
          const TEST_VAR_PASSWORD_LABEL = "password"
          View Source
          const TEST_VAR_SECOND_PROFILE_LABEL = "second_profile"
          View Source
          const TEST_VAR_SECOND_SECTION_KEY = "second_section"
          View Source
          const TEST_VAR_SECOND_SECTION_UNIQUE_KEY_LABEL = "second_section_key"
          View Source
          const TEST_VAR_SECOND_SECTION_UNIQUE_KEY_VALUE = "second section unique value"
          View Source
          const TEST_VAR_USERNAME = "a_test_username"

            Test Environment Labels

            These are used as values for variables within tests.

            View Source
            const TEST_VAR_USERNAME_ALTERNATE = "another_test_username"
            View Source
            const TEST_VAR_USERNAME_ALTERNATE_LABEL = "access_token"
            View Source
            const TEST_VAR_USERNAME_LABEL = "username"
            View Source
            const USERNAME_LABEL = "username"

            Variables

            This section is empty.

            Functions

            func InitTest

            func InitTest(t *testing.T) (*assert.Assertions, zerolog.Logger)

              InitTest is used by test functions to initialize logger settings and the assert pkg.

              Types

              This section is empty.