Skip to content

Commit

Permalink
docs(core): add config docs
Browse files Browse the repository at this point in the history
docs: update CHANGELOG.md
  • Loading branch information
bdreece committed Mar 21, 2024
1 parent 4039ea5 commit 44466f8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add global error handler
- Add bolt DB store
- Add `svelte`
- Add `go fmt` to pre-commit script
- Add `config` docs

### Changed

Expand All @@ -29,8 +31,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Refactor session schema
- Extract `page` package
- Update startup DI
- Update CHANGELOG.md
- Refactor `router` package
- Update spotify API typings
- Update startup DI

### Fixed

- Patch CI workflow
- Patch go version
- Format go files
- Update client side initialization

<!-- generated by git-cliff -->
8 changes: 8 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Package config implements configuration file deserialization
// for providing global options structures.
//
// The config package should be used during startup to inject
// options into dependencies
package config

import (
Expand All @@ -17,6 +22,7 @@ var (
ErrParseConfig = errors.New("failed to parse config file")
)

// A Config provides the schema for configuration files
type Config struct {
AppOptions

Expand All @@ -35,10 +41,12 @@ var defaultConfig = Config{
View: view.DefaultOptions,
}

// Default returns the default configuration values
func Default() *Config {
return &defaultConfig
}

// Load deserializes the configuration file located at the given path
func Load(path string) (*Config, error) {
f, err := os.Open(path)
if err != nil {
Expand Down

0 comments on commit 44466f8

Please sign in to comment.