Skip to content

Commit

Permalink
make julianlint happy
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Feb 26, 2024
1 parent 44bdea9 commit 9d78a97
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion services/store/pkg/store/store.go
Expand Up @@ -68,6 +68,8 @@ func NewStore(opts ...store.Option) store.Store {
return s
}

// Init initializes the store by configuring a storeservice and initializing
// a grpc client if it has not been passed as a context option.
func (s *oss) Init(opts ...store.Option) error {
for _, o := range opts {
o(&s.options)
Expand All @@ -91,10 +93,13 @@ func (s *oss) configure() error {
return nil
}

// Options allows you to view the current options.
func (s *oss) Options() store.Options {
return s.options
}

// Read takes a single key name and optional ReadOptions. It returns matching []*Record or an error.
// Only database and table options are used.
func (s *oss) Read(key string, opts ...store.ReadOption) ([]*store.Record, error) {
options := store.ReadOptions{
Database: s.options.Database,
Expand Down Expand Up @@ -136,8 +141,9 @@ func (s *oss) Read(key string, opts ...store.ReadOption) ([]*store.Record, error
records = append(records, r)
}
return records, nil

}

// Write() writes a record to the store, and returns an error if the record was not written.
func (s *oss) Write(r *store.Record, opts ...store.WriteOption) error {
options := store.WriteOptions{
Database: s.options.Database,
Expand All @@ -161,15 +167,23 @@ func (s *oss) Write(r *store.Record, opts ...store.WriteOption) error {

return err
}

// Delete is not implemented for the ocis service
func (s *oss) Delete(key string, opts ...store.DeleteOption) error {
return errors.ErrUnsupported
}

// List is not implemented for the ocis service
func (s *oss) List(opts ...store.ListOption) ([]string, error) {
return nil, errors.ErrUnsupported
}

// Close does nothing
func (s *oss) Close() error {
return nil
}

// String returns the name of the implementation.
func (s *oss) String() string {
return "ocisstoreservice"
}

0 comments on commit 9d78a97

Please sign in to comment.