package main import ( "io/fs" "os" "riedstra.dev/mitch/steam-export/steam" ) // App binds together the steam library, templates filesystem, handlers, // etc type App struct { Library *steam.Library // Whether or not we're running in demo mode Demo bool ShareLink string Version string templateFS fs.FS staticFS fs.FS } // NewApp sets up the steam library for us func NewApp(libPath string) (*App, error) { lib, err := steam.NewLibrary(libPath) if err != nil { return nil, err } a := &App{ Library: lib, Version: Version, ShareLink: getShareLink(), templateFS: TemplateFS, staticFS: StaticFS, } return a, nil } func (a *App) useLocalFS(pth string) { a.templateFS = os.DirFS(pth) a.staticFS = a.templateFS }