mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
27 lines
536 B
Go
27 lines
536 B
Go
/*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
package ledgerapi
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
// SplitKey splits a key on colon
|
|
func SplitKey(key string) []string {
|
|
return strings.Split(key, ":")
|
|
}
|
|
|
|
// MakeKey joins key parts using colon
|
|
func MakeKey(keyParts ...string) string {
|
|
return strings.Join(keyParts, ":")
|
|
}
|
|
|
|
// StateInterface interface states must implement
|
|
// for use in a list
|
|
type StateInterface interface {
|
|
// GetSplitKey return components that combine to form the key
|
|
GetSplitKey() []string
|
|
Serialize() ([]byte, error)
|
|
}
|