GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

✨ 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 (see mgrg). it's giving birth certificate πŸ’€
  • directory β€” the directory where your application resides, aka the application home directory (see directories). home sweet home 🏠
  • trace-directory β€” the directory where your application's trace files get written, if that's enabled (see directories). the receipts folder fr fr πŸ“
  • root-directory β€” Golf's root directory, meaning where Golf itself is installed (see directories). that's the mothership πŸ›Έ
  • is-service β€” a boolean variable (not a string, bestie, she's different πŸ’…) that's true if your code is running as a service, or false if 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, aka file-storage. your files' dorm room πŸ“
  • db-vendor β€” the database vendor name of the database given by <database configuration> (as used, for example, in run-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) and GG_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 in print-path before the <request path> gets appended.
  • upload-size β€” the maximum allowed size of an uploaded file. heads up: this one is a number (see gg for 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-app See 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