Documentation ¶
Index ¶
- type ConfigSQLiteRepository
- func (configSQLiteRepository *ConfigSQLiteRepository) GetLatest(ctx context.Context, projectName string, env string) (domain.Config, error)
- func (configSQLiteRepository *ConfigSQLiteRepository) GetWithVersion(ctx context.Context, projectName string, env string, version int) (domain.Config, error)
- func (configSQLiteRepository *ConfigSQLiteRepository) Save(ctx context.Context, config domain.Config) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigSQLiteRepository ¶
type ConfigSQLiteRepository struct {
// contains filtered or unexported fields
}
ConfigSQLiteRepository is a struct representing a SQLite implementation of the ConfigRepository interface It has a client field of type sql.DB used to interact with the SQLite database
func NewConfigSQLiteRepository ¶
func NewConfigSQLiteRepository(client sql.DB) (*ConfigSQLiteRepository, error)
NewConfigSQLiteRepository is a function that creates a new instance of ConfigSQLiteRepository with a given client It returns a pointer to the created ConfigSQLiteRepository and an error if any occurred
func (*ConfigSQLiteRepository) GetLatest ¶
func (configSQLiteRepository *ConfigSQLiteRepository) GetLatest(ctx context.Context, projectName string, env string) (domain.Config, error)
GetLatest is a method of ConfigSQLiteRepository that retrieves the latest version of a config for a given project and environment from the SQLite database It takes a context.Context object, a projectName string, and an env string as parameters It returns a domain.Config object and an error if any occurred
func (*ConfigSQLiteRepository) GetWithVersion ¶
func (configSQLiteRepository *ConfigSQLiteRepository) GetWithVersion(ctx context.Context, projectName string, env string, version int) (domain.Config, error)
GetWithVersion is a method of ConfigSQLiteRepository that retrieves a specific version of a config for a given project and environment from the SQLite database It takes a context.Context object, a projectName string, an env string, and a version int as parameters It returns a domain.Config object and an error if any occurred
func (*ConfigSQLiteRepository) Save ¶
func (configSQLiteRepository *ConfigSQLiteRepository) Save(ctx context.Context, config domain.Config) error
Save is a method of ConfigSQLiteRepository that saves a config to the SQLite database It takes a context.Context object and a domain.Config object as parameters It returns an error if any occurred