extstub

package
v0.0.0-...-051a9c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

* Copyright 2017 - 2019 KB Kontrakt LLC - All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *

* Copyright 2017 - 2019 KB Kontrakt LLC - All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *

* Copyright 2017 - 2019 KB Kontrakt LLC - All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *

* Copyright 2017 - 2019 KB Kontrakt LLC - All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *

* Copyright 2017 - 2019 KB Kontrakt LLC - All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound .

Functions

func DefaultFormatError

func DefaultFormatError(err interface{}) interface{}

DefaultFormatError .

func DefaultFormatSuccess

func DefaultFormatSuccess(data interface{}) interface{}

DefaultFormatSuccess .

func NewPrivateHistoryStubDecorator

func NewPrivateHistoryStubDecorator(collectionName string, histStrategy PrivateHistoryStrategy, stub shim.ChaincodeStubInterface) shim.ChaincodeStubInterface

NewPrivateHistoryStubDecorator decorates stub for using private data collection with history request.

func NewPrivateStubDecorator

func NewPrivateStubDecorator(collectionName string, stub shim.ChaincodeStubInterface) shim.ChaincodeStubInterface

NewPrivateStubDecorator decorates stub for using private data collection as a source.

Types

type FactoryFunc

type FactoryFunc func(key string) interface{}

FactoryFunc .

type FormatResponseFunc

type FormatResponseFunc func(data interface{}) interface{}

FormatResponseFunc .

type MarshalPrivState

type MarshalPrivState interface {
	// WriteState .
	WritePrivState(collection, key string, value interface{}) error
	// ReadState .
	ReadPrivState(collection, key string, value interface{}) error
}

MarshalPrivState .

type MarshalQueryState

type MarshalQueryState interface {
	GetAllStates(query string, factFunc FactoryFunc, visitFunc VisitFunc) error
}

MarshalQueryState .

type MarshalState

type MarshalState interface {
	// WriteState .
	WriteState(key string, value interface{}) error
	// ReadState .
	ReadState(key string, value interface{}) error
}

MarshalState .

type MarshalStateImpl

type MarshalStateImpl struct {
	shim.ChaincodeStubInterface
	// contains filtered or unexported fields
}

MarshalStateImpl .

func (*MarshalStateImpl) GetAllStates

func (stub *MarshalStateImpl) GetAllStates(query string, factFunc FactoryFunc, visitFunc VisitFunc) error

GetAllStates .

func (*MarshalStateImpl) ReadPrivState

func (stub *MarshalStateImpl) ReadPrivState(collection, key string, value interface{}) error

ReadPrivState .

func (*MarshalStateImpl) ReadState

func (stub *MarshalStateImpl) ReadState(key string, value interface{}) error

ReadState .

func (*MarshalStateImpl) WritePrivState

func (stub *MarshalStateImpl) WritePrivState(collection, key string, value interface{}) error

WritePrivState .

func (*MarshalStateImpl) WriteState

func (stub *MarshalStateImpl) WriteState(key string, value interface{}) error

WriteState .

type MarshalStub

MarshalStub .

func NewMarshalStateImpl

func NewMarshalStateImpl(stub shim.ChaincodeStubInterface,
	marshalFunc utils.MarshalFunc, unmarshalFunc utils.UnmarshalFunc) MarshalStub

NewMarshalStateImpl .

type PrivateHistoryStrategy

type PrivateHistoryStrategy interface {
	// Append .
	Append(stub shim.ChaincodeStubInterface, collection, key string, value []byte, isDelete bool) error
	// GetIterator .
	GetIterator(stub shim.ChaincodeStubInterface, collection, key string) (shim.HistoryQueryIteratorInterface, error)
}

PrivateHistoryStrategy .

func NewPrivateHistoryArrayAppendStrategy

func NewPrivateHistoryArrayAppendStrategy(keysPrefix, keysSuffix string) PrivateHistoryStrategy

NewPrivateHistoryArrayAppendStrategy .

type Response

type Response interface {
	Send(data interface{}) pb.Response
	SendResponse(data interface{}, err error) pb.Response
	Error(data interface{}) pb.Response
	Success(data interface{}) pb.Response
}

Response .

func NewJSONMarshalResponse

func NewJSONMarshalResponse() Response

NewJSONMarshalResponse .

type VisitFunc

type VisitFunc func(key string, data interface{}) error

VisitFunc .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL