Skip to content

Commit

Permalink
doc: add comments to fix linter
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Oct 6, 2023
1 parent 15e8f28 commit 978efc3
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
1 change: 1 addition & 0 deletions spdk/accel.service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"context"
)

// AccelService is interface to all acceleration functions in spdk
type AccelService interface {
CryptoKeyCreate(ctx context.Context, name string, cipher string, key []byte) (*AccelCryptoKeyCreateResult, error)
CryptoKeyDestroy(context.Context, *AccelCryptoKeyDestroyParams) (*AccelCryptoKeyDestroyResult, error)
Expand Down
17 changes: 13 additions & 4 deletions spdk/accel.service.impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@ import (
"log"
)

// AccelServiceImpl implements AccelService interface
type AccelServiceImpl struct {
client JSONRPC
}

func NewAccelService() AccelService {
// build time check that struct implements interface
var _ AccelService = (*AccelServiceImpl)(nil)

// NewAccelService is a constructor for AccelServiceImpl
func NewAccelService() *AccelServiceImpl {

Check warning on line 23 in spdk/accel.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/accel.service.impl.go#L23

Added line #L23 was not covered by tests
// client := spdk.NewSpdkJSONRPC(spdkAddress)
return &AccelServiceImpl{nil}

Check warning on line 25 in spdk/accel.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/accel.service.impl.go#L25

Added line #L25 was not covered by tests
}

// CryptoKeyCreate creates crypto key
func (p *AccelServiceImpl) CryptoKeyCreate(ctx context.Context, name string, cipher string, key []byte) (*AccelCryptoKeyCreateResult, error) {

Check warning on line 29 in spdk/accel.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/accel.service.impl.go#L29

Added line #L29 was not covered by tests
// TBD
keyHalf := len(key) / 2
Expand All @@ -44,17 +50,20 @@ func (p *AccelServiceImpl) CryptoKeyCreate(ctx context.Context, name string, cip
return nil, nil
}

func (p *AccelServiceImpl) CryptoKeyDestroy(_ context.Context, params *AccelCryptoKeyDestroyParams) (*AccelCryptoKeyDestroyResult, error) {
// CryptoKeyDestroy destroys crypto key
func (p *AccelServiceImpl) CryptoKeyDestroy(_ context.Context, _ *AccelCryptoKeyDestroyParams) (*AccelCryptoKeyDestroyResult, error) {

Check warning on line 54 in spdk/accel.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/accel.service.impl.go#L54

Added line #L54 was not covered by tests
// TBD
return nil, nil
}

func (p *AccelServiceImpl) CryptoKeyList(_ context.Context, params *AccelCryptoKeyGetParams) (*AccelCryptoKeyGetResult, error) {
// CryptoKeyList lists crypto keys
func (p *AccelServiceImpl) CryptoKeyList(_ context.Context, _ *AccelCryptoKeyGetParams) (*AccelCryptoKeyGetResult, error) {

Check warning on line 60 in spdk/accel.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/accel.service.impl.go#L60

Added line #L60 was not covered by tests
// TBD
return nil, nil
}

func (p *AccelServiceImpl) GetStats(_ context.Context, params *NvmfCreateSubsystemParams) (*NvmfCreateSubsystemResult, error) {
// GetStats gets crypto key stats
func (p *AccelServiceImpl) GetStats(_ context.Context, _ *NvmfCreateSubsystemParams) (*NvmfCreateSubsystemResult, error) {

Check warning on line 66 in spdk/accel.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/accel.service.impl.go#L66

Added line #L66 was not covered by tests
// TBD
return nil, nil
}
1 change: 1 addition & 0 deletions spdk/lvol.service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"context"
)

// LvolService is interface to all logical volumes functions in spdk
type LvolService interface {
CreateLvstore(context.Context, *NvmfCreateSubsystemParams) (*NvmfCreateSubsystemResult, error)
DeleteLvstore(context.Context, *NvmfDeleteSubsystemParams) (*NvmfDeleteSubsystemResult, error)
Expand Down
1 change: 1 addition & 0 deletions spdk/nvmf.service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"context"
)

// NvmfService is interface to all nvme over fabric functions in spdk
type NvmfService interface {
CreateSubsystem(ctx context.Context, nqn string, serial string, model string, ns int) (*NvmfCreateSubsystemResult, error)
DeleteSubsystem(context.Context, *NvmfDeleteSubsystemParams) (*NvmfDeleteSubsystemResult, error)
Expand Down
15 changes: 14 additions & 1 deletion spdk/nvmf.service.impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@ import (
"log"
)

// NvmfServiceImpl implements NvmfService interface
type NvmfServiceImpl struct {
client JSONRPC
}

func NewNvmfService() NvmfService {
// build time check that struct implements interface
var _ NvmfService = (*NvmfServiceImpl)(nil)

// NewNvmfService is a constructor for NvmfServiceImpl
func NewNvmfService() *NvmfServiceImpl {

Check warning on line 22 in spdk/nvmf.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/nvmf.service.impl.go#L22

Added line #L22 was not covered by tests
// client := spdk.NewSpdkJSONRPC(spdkAddress)
return &NvmfServiceImpl{nil}

Check warning on line 24 in spdk/nvmf.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/nvmf.service.impl.go#L24

Added line #L24 was not covered by tests
}

// CreateSubsystem creates nvme subsystem
func (p *NvmfServiceImpl) CreateSubsystem(ctx context.Context, nqn string, serial string, model string, ns int) (*NvmfCreateSubsystemResult, error) {

Check warning on line 28 in spdk/nvmf.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/nvmf.service.impl.go#L28

Added line #L28 was not covered by tests
// TBD
params := NvmfCreateSubsystemParams{
Expand All @@ -43,36 +49,43 @@ func (p *NvmfServiceImpl) CreateSubsystem(ctx context.Context, nqn string, seria
return nil, nil
}

// DeleteSubsystem deletes nvme subsystem
func (p *NvmfServiceImpl) DeleteSubsystem(context.Context, *NvmfDeleteSubsystemParams) (*NvmfDeleteSubsystemResult, error) {

Check warning on line 53 in spdk/nvmf.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/nvmf.service.impl.go#L53

Added line #L53 was not covered by tests
// TBD
return nil, nil
}

// GetSubsystems gets nvme subsystem
func (p *NvmfServiceImpl) GetSubsystems(_ context.Context, page int, limit int) (*NvmfGetSubsystemsResult, error) {

Check warning on line 59 in spdk/nvmf.service.impl.go

View workflow job for this annotation

GitHub Actions / call / golangci

unused-parameter: parameter 'page' seems to be unused, consider removing or renaming it as _ (revive)

Check warning on line 59 in spdk/nvmf.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/nvmf.service.impl.go#L59

Added line #L59 was not covered by tests
// TBD
return nil, nil
}

// GetStats gets nvme subsystem stats
func (p *NvmfServiceImpl) GetStats(_ context.Context, page int, limit int) (*NvmfGetSubsystemStatsResult, error) {

Check warning on line 65 in spdk/nvmf.service.impl.go

View workflow job for this annotation

GitHub Actions / call / golangci

unused-parameter: parameter 'page' seems to be unused, consider removing or renaming it as _ (revive)

Check warning on line 65 in spdk/nvmf.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/nvmf.service.impl.go#L65

Added line #L65 was not covered by tests
// TBD
return nil, nil
}

// AddListener adds nvme listener
func (p *NvmfServiceImpl) AddListener(context.Context, *NvmfSubsystemAddListenerParams) (*NvmfSubsystemAddListenerResult, error) {

Check warning on line 71 in spdk/nvmf.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/nvmf.service.impl.go#L71

Added line #L71 was not covered by tests
// TBD
return nil, nil
}

// RemoveListener removes nvme listener
func (p *NvmfServiceImpl) RemoveListener(context.Context, *NvmfSubsystemAddListenerParams) (*NvmfSubsystemAddListenerResult, error) {

Check warning on line 77 in spdk/nvmf.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/nvmf.service.impl.go#L77

Added line #L77 was not covered by tests
// TBD
return nil, nil
}

// AddNamespace adds nvme namespace
func (p *NvmfServiceImpl) AddNamespace(context.Context, *NvmfSubsystemAddNsParams) (*NvmfSubsystemAddNsResult, error) {

Check warning on line 83 in spdk/nvmf.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/nvmf.service.impl.go#L83

Added line #L83 was not covered by tests
// TBD
return nil, nil
}

// RemoveNamespace removes nvme namespace
func (p *NvmfServiceImpl) RemoveNamespace(context.Context, *NvmfSubsystemRemoveNsParams) (*NvmfSubsystemRemoveNsResult, error) {

Check warning on line 89 in spdk/nvmf.service.impl.go

View check run for this annotation

Codecov / codecov/patch

spdk/nvmf.service.impl.go#L89

Added line #L89 was not covered by tests
// TBD
return nil, nil
Expand Down

0 comments on commit 978efc3

Please sign in to comment.