Documentation ¶
Index ¶
- func AppID() (string, error)
- func AppKey() string
- func AppName() string
- func CertFile() string
- func CertPath() string
- func ClientID() (string, error)
- func ClientSecret() (string, error)
- func DatabasePath() string
- func Domain() string
- func ExistsError(filename string) error
- func GetAccessToken() (string, error)
- func HasAppID() bool
- func IsLocal(domain string) bool
- func KeyFile() string
- func Load(filename string) error
- func MissingError(filename string) error
- func Prepared(filename string) error
- func PublicDir() string
- func PublicEnv(envFile string) string
- func RepositoryPath() string
- func Root() string
- func RootEnv(envFile string) string
- func Save(filename string, env map[string]string) error
- func ScmProvider() string
- func SetFakeProvider(t *testing.T)
- func TestdataPath() string
- func Whitelist() ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppKey ¶
func AppKey() string
AppKey returns path to the file with .pem private key. For GitHub apps a key must be generated on the App's settings page and saved into a file.
func CertFile ¶
func CertFile() string
CertFile returns the full path to the certificate file. To specify a different file, use the QUICKFEED_CERT_FILE environment variable.
func CertPath ¶
func CertPath() string
CertPath returns the full path to the directory containing the certificates. If QUICKFEED_CERT_PATH is not set, the default path $QUICKFEED/internal/config/certs is used.
func ClientSecret ¶
ClientSecret returns the client secret for the current SCM provider.
func Domain ¶
func Domain() string
Domain returns the domain name where quickfeed will be served. Domain should not include the server name.
func ExistsError ¶
func GetAccessToken ¶
func KeyFile ¶
func KeyFile() string
KeyFile returns the full path to the certificate key file. To specify a different key, use the QUICKFEED_KEY_FILE environment variable.
func Load ¶
Load loads environment variables from the given file, or from $QUICKFEED/.env. The variable's values are expanded with existing variables from the environment. It will not override a variable that already exists in the environment.
func MissingError ¶
func Prepared ¶
Prepared returns nil if the given env file exists and the corresponding backup file does not. Otherwise, it returns an error.
If the env file does not exist, a MissingError returned. QuickFeed requires the env file to load (some) existing environment variables, even when creating a new GitHub app, and overwriting some environment variables. If the backup file exists, an ExistsError is returned. This is to avoid that QuickFeed overwrites an existing backup file.
func RepositoryPath ¶
func RepositoryPath() string
func Root ¶
func Root() string
Root returns the root directory as defined by $QUICKFEED or sets it relative to the quickfeed module's root. This function will panic if called when the working directory is not within the quickfeed repository. In this case, the environment variable $QUICKFEED must be set manually.
func Save ¶
Save writes the given environment variables to the given file, replacing or leaving behind existing variables.
If the file exists, it will be updated, but leaving a backup file. If a backup already exists it will be removed first.
func ScmProvider ¶
func ScmProvider() string
ScmProvider returns the current SCM provider supported by this backend.
func SetFakeProvider ¶
SetFakeProvider sets the provider to fake. This is only for testing. The t argument is added as a reminder that this is only for testing.
func TestdataPath ¶
func TestdataPath() string
TestdataPath returns the path to the testdata/courses directory.
Types ¶
This section is empty.