Debian Codegraph @

extension/xextension/storage/nop_client.go

raw symbols SCIP
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3
4 package storage // import "go.opentelemetry.io/collector/extension/xextension/storage"
5
6 import "context"
7
8 type nopClient struct{}
9
10 var nopClientInstance Client = &nopClient{}
11
12 // NewNopClient returns a nop client
13 func NewNopClient() Client {
14 return nopClientInstance
15 }
16
17 // Get does nothing, and returns nil, nil
18 func (c nopClient) Get(context.Context, string) ([]byte, error) {
19 return nil, nil // no result, but no problem
20 }
21
22 // Set does nothing and returns nil
23 func (c nopClient) Set(context.Context, string, []byte) error {
24 return nil // no problem
25 }
26
27 // Delete does nothing and returns nil
28 func (c nopClient) Delete(context.Context, string) error {
29 return nil // no problem
30 }
31
32 // Close does nothing and returns nil
33 func (c nopClient) Close(context.Context) error {
34 return nil
35 }
36
37 // Batch does nothing, and returns nil, nil
38 func (c nopClient) Batch(context.Context, ...*Operation) error {
39 return nil // no result, but no problem
40 }