diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2017-11-07 14:57:29 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@gmail.com> | 2017-11-18 12:54:05 -0500 |
commit | cb56716fc4bb632db84fab372fff8f5a9007ed3f (patch) | |
tree | cb387412db9b9233de3a8c7e9861ef8463c79030 /libpod/sql_state.go | |
parent | c6fe4430b76ceeecd6b0b609cca8e705921db0c4 (diff) | |
download | podman-cb56716fc4bb632db84fab372fff8f5a9007ed3f.tar.gz podman-cb56716fc4bb632db84fab372fff8f5a9007ed3f.tar.bz2 podman-cb56716fc4bb632db84fab372fff8f5a9007ed3f.zip |
Address review comments, fix gofmt and lint
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'libpod/sql_state.go')
-rw-r--r-- | libpod/sql_state.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libpod/sql_state.go b/libpod/sql_state.go index 0564d124f..1218bfa79 100644 --- a/libpod/sql_state.go +++ b/libpod/sql_state.go @@ -7,12 +7,14 @@ import ( "os" "github.com/containers/storage" - _ "github.com/mattn/go-sqlite3" "github.com/pkg/errors" "github.com/sirupsen/logrus" + + // Use SQLite backend for sql package + _ "github.com/mattn/go-sqlite3" ) -// SqlState is a state implementation backed by a persistent SQLite3 database +// SQLState is a state implementation backed by a persistent SQLite3 database type SQLState struct { db *sql.DB specsDir string @@ -22,7 +24,7 @@ type SQLState struct { } // NewSqlState initializes a SQL-backed state, created the database if necessary -func NewSqlState(dbPath, lockPath, specsDir string, runtime *Runtime) (State, error) { +func NewSQLState(dbPath, lockPath, specsDir string, runtime *Runtime) (State, error) { state := new(SQLState) state.runtime = runtime @@ -85,8 +87,7 @@ func (s *SQLState) Close() error { s.valid = false - err := s.db.Close() - if err != nil { + if err := s.db.Close(); err != nil { return errors.Wrapf(err, "error closing database") } @@ -427,6 +428,7 @@ func (s *SQLState) RemovePod(pod *Pod) error { return ErrNotImplemented } +// AllPods retrieves all pods presently in the state func (s *SQLState) AllPods() ([]*Pod, error) { return nil, ErrNotImplemented } |