-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to comments and CONTRIBUTING.md
- Loading branch information
1 parent
9daf31f
commit 17f2ba3
Showing
34 changed files
with
248 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,46 @@ | ||
package config | ||
|
||
// ConfigService is an implementation of the config.Service interface | ||
type ConfigService struct { | ||
repo Repo | ||
} | ||
|
||
// NewConfigService returns a new instance of ConfigService | ||
func NewConfigService(repo Repo) *ConfigService { | ||
return &ConfigService{repo: repo} | ||
} | ||
|
||
// Get returns a config by id | ||
func (s *ConfigService) Get(id int) (*Config, error) { | ||
return s.repo.Get(id) | ||
} | ||
|
||
// GetAll returns all stored configs | ||
func (s *ConfigService) GetAll() ([]*Config, error) { | ||
return s.repo.GetAll() | ||
} | ||
|
||
// Create creates a new config | ||
func (s *ConfigService) Create(conf *Config) (*Config, error) { | ||
return s.repo.Create(conf) | ||
} | ||
|
||
// Update updates an existing config | ||
func (s *ConfigService) Update(conf *Config) (*Config, error) { | ||
return s.repo.Update(conf) | ||
} | ||
|
||
// Delete deletes a config | ||
func (s *ConfigService) Delete(id int) error { | ||
return s.repo.Delete(id) | ||
} | ||
|
||
// SetLasLoaded sets the "loaded" field for a config to current timestamp | ||
func (s *ConfigService) SetLastLoaded(id int) error { | ||
return s.repo.SetLastLoaded(id) | ||
} | ||
|
||
// LastLoaded retrieves the most recently loaded config | ||
func (s *ConfigService) LastLoaded() (*Config, error) { | ||
return s.repo.LastLoaded() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.