Skip to content

Commit

Permalink
fix stykle
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Jan 31, 2024
1 parent 7a297b2 commit 2a9e223
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/coreapi/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (

type RoutingAPI CoreAPI

func (r *RoutingAPI) Get(ctx context.Context, key string) ([]byte, error) {
if !r.nd.IsOnline {
func (api *RoutingAPI) Get(ctx context.Context, key string) ([]byte, error) {
if !api.nd.IsOnline {
return nil, coreiface.ErrOffline
}

Expand All @@ -34,16 +34,16 @@ func (r *RoutingAPI) Get(ctx context.Context, key string) ([]byte, error) {
return nil, err
}

return r.routing.GetValue(ctx, dhtKey)
return api.routing.GetValue(ctx, dhtKey)
}

func (r *RoutingAPI) Put(ctx context.Context, key string, value []byte, opts ...caopts.RoutingPutOption) error {
func (api *RoutingAPI) Put(ctx context.Context, key string, value []byte, opts ...caopts.RoutingPutOption) error {
options, err := caopts.RoutingPutOptions(opts...)
if err != nil {
return err
}

err = r.checkOnline(options.AllowOffline)
err = api.checkOnline(options.AllowOffline)
if err != nil {
return err
}
Expand All @@ -53,7 +53,7 @@ func (r *RoutingAPI) Put(ctx context.Context, key string, value []byte, opts ...
return err
}

return r.routing.PutValue(ctx, dhtKey, value)
return api.routing.PutValue(ctx, dhtKey, value)
}

func normalizeKey(s string) (string, error) {
Expand Down

0 comments on commit 2a9e223

Please sign in to comment.