Skip to content

Commit

Permalink
Added internal CPMap functions (#987)
Browse files Browse the repository at this point in the history
Added internal CPMap functions
  • Loading branch information
yuce authored Dec 11, 2023
1 parent b0af758 commit f728b86
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nightly_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
go_version: [ 1.20, 1.21 ]
go_version: [ "1.20", "1.21" ]
fail-fast: false
steps:

Expand All @@ -22,7 +22,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go_version }}
go-version: "${{ matrix.go_version }}"

- name: Checkout code
uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const (

type AtomicLong = icp.AtomicLong
type AtomicRef = icp.AtomicRef
type CPMap = icp.Map
type CPSubsystem = icp.Subsystem

func NewLockContext(ctx context.Context) context.Context {
Expand Down
16 changes: 15 additions & 1 deletion client_internals.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (ci *ClientInternal) PartitionCount() int32 {
return ci.client.ic.PartitionService.PartitionCount()
}

// Internal AtomicRef methods
// Internal AtomicRef functions

func AtomicRefGetData(ctx context.Context, ar *AtomicRef) (Data, error) {
return icp.AtomicRefGetData(ctx, ar)
Expand All @@ -204,6 +204,20 @@ func AtomicRefGetAndSetData(ctx context.Context, ar *AtomicRef, value Data) (Dat
return icp.AtomicRefGetAndSetData(ctx, ar, value)
}

// Internal CPMap functions

func CPMapGetData(ctx context.Context, m *CPMap, key Data) (Data, error) {
return icp.CPMapGetData(ctx, m, key)
}

func CPMapPutData(ctx context.Context, m *CPMap, key, value Data) (Data, error) {
return icp.CPMapPutData(ctx, m, key, value)
}

func CPMapRemoveData(ctx context.Context, m *CPMap, key Data) (Data, error) {
return icp.CPMapRemoveData(ctx, m, key)
}

const (
TypeFieldOffset = proto.TypeFieldOffset
MessageTypeOffset = proto.MessageTypeOffset
Expand Down

0 comments on commit f728b86

Please sign in to comment.