diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..651cbade --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/gofiber/storage + +go 1.15 + +require github.com/gofiber/fiber v1.14.6 diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..66bdb5af --- /dev/null +++ b/go.sum @@ -0,0 +1,28 @@ +github.com/andybalholm/brotli v1.0.0 h1:7UCwP93aiSfvWpapti8g88vVVGp2qqtGyePsSuDafo4= +github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/gofiber/fiber v1.14.6 h1:QRUPvPmr8ijQuGo1MgupHBn8E+wW0IKqiOvIZPtV70o= +github.com/gofiber/fiber v1.14.6/go.mod h1:Yw2ekF1YDPreO9V6TMYjynu94xRxZBdaa8X5HhHsjCM= +github.com/gofiber/utils v0.0.10 h1:3Mr7X7JdCUo7CWf/i5sajSaDmArEDtti8bM1JUVso2U= +github.com/gofiber/utils v0.0.10/go.mod h1:9J5aHFUIjq0XfknT4+hdSMG6/jzfaAgCu4HEbWDeBlo= +github.com/gorilla/schema v1.1.0 h1:CamqUDOFUBqzrvxuz2vEwo8+SUdwsluFh7IlzJh30LY= +github.com/gorilla/schema v1.1.0/go.mod h1:kgLaKoK1FELgZqMAVxx/5cbj0kT+57qxUrAlIO2eleU= +github.com/klauspost/compress v1.10.7 h1:7rix8v8GpI3ZBb0nSozFRgbtXKv+hOe+qfEpZqybrAg= +github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasthttp v1.16.0 h1:9zAqOYLl8Tuy3E5R6ckzGDJ1g8+pw15oQp2iL9Jl6gQ= +github.com/valyala/fasthttp v1.16.0/go.mod h1:YOKImeEosDdBPnxc0gy7INqi3m1zK6A+xl6TwOBhHCA= +github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 h1:OjiUf46hAmXblsZdnoSXsEUSKU8r1UEzcL5RVZ4gO9Y= +golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/memcached/memcached.go b/memcached/memcached.go new file mode 100644 index 00000000..c69d5168 --- /dev/null +++ b/memcached/memcached.go @@ -0,0 +1,41 @@ +package memcached + +import ( + "time" +) + +// Storage interface that is implemented by storage providers +type Storage struct { +} + +// Config defines the config for mysql storage. +type Config struct { +} + +// ConfigDefault is the default config +var ConfigDefault = Config{} + +// New creates a new mysql storage +func New(config ...Config) Storage { + return Storage{} +} + +// Get value by key +func (store Storage) Get(key string) ([]byte, error) { + return []byte{}, nil +} + +// Set key with value +func (store Storage) Set(key string, val []byte, exp time.Duration) error { + return nil +} + +// Delete key by key +func (store Storage) Delete(key string) error { + return nil +} + +// Clear all keys +func (store Storage) Clear() error { + return nil +} diff --git a/memcached/memcached_test.go b/memcached/memcached_test.go new file mode 100644 index 00000000..69ea8796 --- /dev/null +++ b/memcached/memcached_test.go @@ -0,0 +1 @@ +package memcached diff --git a/mongodb/mongodb.go b/mongodb/mongodb.go new file mode 100644 index 00000000..725cc7b9 --- /dev/null +++ b/mongodb/mongodb.go @@ -0,0 +1,41 @@ +package mongodb + +import ( + "time" +) + +// Storage interface that is implemented by storage providers +type Storage struct { +} + +// Config defines the config for mysql storage. +type Config struct { +} + +// ConfigDefault is the default config +var ConfigDefault = Config{} + +// New creates a new mysql storage +func New(config ...Config) Storage { + return Storage{} +} + +// Get value by key +func (store Storage) Get(key string) ([]byte, error) { + return []byte{}, nil +} + +// Set key with value +func (store Storage) Set(key string, val []byte, exp time.Duration) error { + return nil +} + +// Delete key by key +func (store Storage) Delete(key string) error { + return nil +} + +// Clear all keys +func (store Storage) Clear() error { + return nil +} diff --git a/mongodb/mongodb_test.go b/mongodb/mongodb_test.go new file mode 100644 index 00000000..6e598913 --- /dev/null +++ b/mongodb/mongodb_test.go @@ -0,0 +1 @@ +package mongodb diff --git a/mysql/mysql.go b/mysql/mysql.go new file mode 100644 index 00000000..8355669e --- /dev/null +++ b/mysql/mysql.go @@ -0,0 +1,41 @@ +package mysql + +import ( + "time" +) + +// Storage interface that is implemented by storage providers +type Storage struct { +} + +// Config defines the config for mysql storage. +type Config struct { +} + +// ConfigDefault is the default config +var ConfigDefault = Config{} + +// New creates a new mysql storage +func New(config ...Config) Storage { + return Storage{} +} + +// Get value by key +func (store Storage) Get(key string) ([]byte, error) { + return []byte{}, nil +} + +// Set key with value +func (store Storage) Set(key string, val []byte, exp time.Duration) error { + return nil +} + +// Delete key by key +func (store Storage) Delete(key string) error { + return nil +} + +// Clear all keys +func (store Storage) Clear() error { + return nil +} diff --git a/mysql/mysql_test.go b/mysql/mysql_test.go new file mode 100644 index 00000000..b0843023 --- /dev/null +++ b/mysql/mysql_test.go @@ -0,0 +1 @@ +package mysql diff --git a/postgres/postgres.go b/postgres/postgres.go new file mode 100644 index 00000000..e4174f87 --- /dev/null +++ b/postgres/postgres.go @@ -0,0 +1,41 @@ +package postgres + +import ( + "time" +) + +// Storage interface that is implemented by storage providers +type Storage struct { +} + +// Config defines the config for mysql storage. +type Config struct { +} + +// ConfigDefault is the default config +var ConfigDefault = Config{} + +// New creates a new mysql storage +func New(config ...Config) Storage { + return Storage{} +} + +// Get value by key +func (store Storage) Get(key string) ([]byte, error) { + return []byte{}, nil +} + +// Set key with value +func (store Storage) Set(key string, val []byte, exp time.Duration) error { + return nil +} + +// Delete key by key +func (store Storage) Delete(key string) error { + return nil +} + +// Clear all keys +func (store Storage) Clear() error { + return nil +} diff --git a/postgres/postgres_test.go b/postgres/postgres_test.go new file mode 100644 index 00000000..bf560bea --- /dev/null +++ b/postgres/postgres_test.go @@ -0,0 +1 @@ +package postgres diff --git a/sqlite3/sqlite3.go b/sqlite3/sqlite3.go new file mode 100644 index 00000000..26defac5 --- /dev/null +++ b/sqlite3/sqlite3.go @@ -0,0 +1,41 @@ +package sqlite3 + +import ( + "time" +) + +// Storage interface that is implemented by storage providers +type Storage struct { +} + +// Config defines the config for mysql storage. +type Config struct { +} + +// ConfigDefault is the default config +var ConfigDefault = Config{} + +// New creates a new mysql storage +func New(config ...Config) Storage { + return Storage{} +} + +// Get value by key +func (store Storage) Get(key string) ([]byte, error) { + return []byte{}, nil +} + +// Set key with value +func (store Storage) Set(key string, val []byte, exp time.Duration) error { + return nil +} + +// Delete key by key +func (store Storage) Delete(key string) error { + return nil +} + +// Clear all keys +func (store Storage) Clear() error { + return nil +} diff --git a/sqlite3/sqlite3_test.go b/sqlite3/sqlite3_test.go new file mode 100644 index 00000000..4f24317a --- /dev/null +++ b/sqlite3/sqlite3_test.go @@ -0,0 +1 @@ +package sqlite3