GOLF(2gg)
β¨ GOLF(2gg) β¨
okay bestie, welcome to the get-app page from the Golf manual (that's section 2gg of the Golf development docs, iykyk) π
πΈ NAME πΈ
get-app β the application-information girly π«Ά she's literally just here to tell you stuff about your app
π PURPOSE π
Obtain data that describes the application. That's it, that's the job. She's nosy and we love her for it π
π¦ SYNTAX π¦
get-app \
name | directory | trace-directory | file-directory | root-directory \
| db-vendor <database configuration> | upload-size \
| path | is-service \
to <variable>
so you pick one of those things, and you yeet it into <variable>. periodt β¨
π DESCRIPTION π
Application-related variables can be obtained with the get-app statement. Here's the whole menu of application variables you can grab β they're all strings unless I say otherwise, no cap:
nameβ returns the name of your application, exactly as specified when it was created (seemgrg). it's giving birth certificate πdirectoryβ the directory where your application resides, aka the application home directory (seedirectories). home sweet home πtrace-directoryβ the directory where your application's trace files get written, if that's enabled (seedirectories). the receipts folder fr fr πroot-directoryβ Golf's root directory, meaning where Golf itself is installed (seedirectories). that's the mothership πΈis-serviceβ a boolean variable (not a string, bestie, she's different π ) that'strueif your code is running as a service, orfalseif it's running as a command-line program. vibe check: are you a background girly or a terminal girly?file-directoryβ the directory where the Golf file storage system lives, akafile-storage. your files' dorm room πdb-vendorβ the database vendor name of the database given by<database configuration>(as used, for example, inrun-query). you can use this to create database-specific conditions π§ the vendor name can be compared against these predefined string constants:GG_MARIADB(for a MariaDB database),GG_POSTGRES(for a Postgres database) andGG_SQLITE(for a SQLite database). pick your fighter βοΈpathβ the leading path of the URL request, which you can use to build web forms and links that lead back to your application π it returns the same value as used inprint-pathbefore the<request path>gets appended.upload-sizeβ the maximum allowed size of an uploaded file. heads up: this one is a number (seeggfor how to set this value). big files? not on her watch π
π₯ EXAMPLES π₯
Get the name of your Golf application:
get-app name to appname
Get the vendor of database db:
get-app db-vendor db to dbv
if-true dbv equal GG_POSTGRES
// do something Postgres specific
end-if
look at you, branching on the database vendor, main character energy π
π SEE ALSO π
- Application information
get-appSee all documentation
and that's the whole page, bestie!! this was GOLF(2gg) from $VERSION, dated $DATE β go get those app variables, you're doing amazing sweetie π«Άβ¨
π¦ where this page comes from
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms