cscc

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Overview

Package cscc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_systemcc_cscc_cscc_proto protoreflect.FileDescriptor
View Source
var Swagger []byte

Functions

func RegisterCSCCServiceHandler

func RegisterCSCCServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterCSCCServiceHandler registers the http handlers for service CSCCService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterCSCCServiceHandlerClient

func RegisterCSCCServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CSCCServiceClient) error

RegisterCSCCServiceHandlerClient registers the http handlers for service CSCCService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CSCCServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CSCCServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CSCCServiceClient" to call the correct interceptors.

func RegisterCSCCServiceHandlerFromEndpoint

func RegisterCSCCServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterCSCCServiceHandlerFromEndpoint is same as RegisterCSCCServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterCSCCServiceHandlerServer

func RegisterCSCCServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CSCCServiceServer) error

RegisterCSCCServiceHandlerServer registers the http handlers for service CSCCService to "mux". UnaryRPC :call CSCCServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterCSCCServiceHandlerFromEndpoint instead.

func RegisterCSCCServiceServer

func RegisterCSCCServiceServer(s *grpc.Server, srv CSCCServiceServer)

Types

type CSCCServiceClient

type CSCCServiceClient interface {
	// GetChainInfo allows joining channel using presented genesis block
	JoinChain(ctx context.Context, in *JoinChainRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	GetChannels(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*peer.ChannelQueryResponse, error)
	// GetConfigBlock returns genesis block of channel
	GetConfigBlock(ctx context.Context, in *GetConfigBlockRequest, opts ...grpc.CallOption) (*common.Block, error)
	// GetChannelConfig returns channel configuration
	GetChannelConfig(ctx context.Context, in *GetChannelConfigRequest, opts ...grpc.CallOption) (*common.Config, error)
}

CSCCServiceClient is the client API for CSCCService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type CSCCServiceServer

type CSCCServiceServer interface {
	// GetChainInfo allows joining channel using presented genesis block
	JoinChain(context.Context, *JoinChainRequest) (*emptypb.Empty, error)
	GetChannels(context.Context, *emptypb.Empty) (*peer.ChannelQueryResponse, error)
	// GetConfigBlock returns genesis block of channel
	GetConfigBlock(context.Context, *GetConfigBlockRequest) (*common.Block, error)
	// GetChannelConfig returns channel configuration
	GetChannelConfig(context.Context, *GetChannelConfigRequest) (*common.Config, error)
}

CSCCServiceServer is the server API for CSCCService service.

type GetChannelConfigRequest

type GetChannelConfigRequest struct {
	Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"`
	// contains filtered or unexported fields
}

func (*GetChannelConfigRequest) Descriptor deprecated

func (*GetChannelConfigRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetChannelConfigRequest.ProtoReflect.Descriptor instead.

func (*GetChannelConfigRequest) GetChannel

func (x *GetChannelConfigRequest) GetChannel() string

func (*GetChannelConfigRequest) ProtoMessage

func (*GetChannelConfigRequest) ProtoMessage()

func (*GetChannelConfigRequest) ProtoReflect

func (x *GetChannelConfigRequest) ProtoReflect() protoreflect.Message

func (*GetChannelConfigRequest) Reset

func (x *GetChannelConfigRequest) Reset()

func (*GetChannelConfigRequest) String

func (x *GetChannelConfigRequest) String() string

func (*GetChannelConfigRequest) Validate

func (m *GetChannelConfigRequest) Validate() error

Validate checks the field values on GetChannelConfigRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetChannelConfigRequest) ValidateAll

func (m *GetChannelConfigRequest) ValidateAll() error

ValidateAll checks the field values on GetChannelConfigRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetChannelConfigRequestMultiError, or nil if none found.

type GetChannelConfigRequestMultiError

type GetChannelConfigRequestMultiError []error

GetChannelConfigRequestMultiError is an error wrapping multiple validation errors returned by GetChannelConfigRequest.ValidateAll() if the designated constraints aren't met.

func (GetChannelConfigRequestMultiError) AllErrors

func (m GetChannelConfigRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetChannelConfigRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type GetChannelConfigRequestValidationError

type GetChannelConfigRequestValidationError struct {
	// contains filtered or unexported fields
}

GetChannelConfigRequestValidationError is the validation error returned by GetChannelConfigRequest.Validate if the designated constraints aren't met.

func (GetChannelConfigRequestValidationError) Cause

Cause function returns cause value.

func (GetChannelConfigRequestValidationError) Error

Error satisfies the builtin error interface

func (GetChannelConfigRequestValidationError) ErrorName

ErrorName returns error name.

func (GetChannelConfigRequestValidationError) Field

Field function returns field value.

func (GetChannelConfigRequestValidationError) Key

Key function returns key value.

func (GetChannelConfigRequestValidationError) Reason

Reason function returns reason value.

type GetConfigBlockRequest

type GetConfigBlockRequest struct {
	Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"`
	// contains filtered or unexported fields
}

func (*GetConfigBlockRequest) Descriptor deprecated

func (*GetConfigBlockRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetConfigBlockRequest.ProtoReflect.Descriptor instead.

func (*GetConfigBlockRequest) GetChannel

func (x *GetConfigBlockRequest) GetChannel() string

func (*GetConfigBlockRequest) ProtoMessage

func (*GetConfigBlockRequest) ProtoMessage()

func (*GetConfigBlockRequest) ProtoReflect

func (x *GetConfigBlockRequest) ProtoReflect() protoreflect.Message

func (*GetConfigBlockRequest) Reset

func (x *GetConfigBlockRequest) Reset()

func (*GetConfigBlockRequest) String

func (x *GetConfigBlockRequest) String() string

func (*GetConfigBlockRequest) Validate

func (m *GetConfigBlockRequest) Validate() error

Validate checks the field values on GetConfigBlockRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetConfigBlockRequest) ValidateAll

func (m *GetConfigBlockRequest) ValidateAll() error

ValidateAll checks the field values on GetConfigBlockRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetConfigBlockRequestMultiError, or nil if none found.

type GetConfigBlockRequestMultiError

type GetConfigBlockRequestMultiError []error

GetConfigBlockRequestMultiError is an error wrapping multiple validation errors returned by GetConfigBlockRequest.ValidateAll() if the designated constraints aren't met.

func (GetConfigBlockRequestMultiError) AllErrors

func (m GetConfigBlockRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetConfigBlockRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type GetConfigBlockRequestValidationError

type GetConfigBlockRequestValidationError struct {
	// contains filtered or unexported fields
}

GetConfigBlockRequestValidationError is the validation error returned by GetConfigBlockRequest.Validate if the designated constraints aren't met.

func (GetConfigBlockRequestValidationError) Cause

Cause function returns cause value.

func (GetConfigBlockRequestValidationError) Error

Error satisfies the builtin error interface

func (GetConfigBlockRequestValidationError) ErrorName

ErrorName returns error name.

func (GetConfigBlockRequestValidationError) Field

Field function returns field value.

func (GetConfigBlockRequestValidationError) Key

Key function returns key value.

func (GetConfigBlockRequestValidationError) Reason

Reason function returns reason value.

type JoinChainRequest

type JoinChainRequest struct {
	Channel      string        `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"`
	GenesisBlock *common.Block `protobuf:"bytes,2,opt,name=genesis_block,json=genesisBlock,proto3" json:"genesis_block,omitempty"`
	// contains filtered or unexported fields
}

func (*JoinChainRequest) Descriptor deprecated

func (*JoinChainRequest) Descriptor() ([]byte, []int)

Deprecated: Use JoinChainRequest.ProtoReflect.Descriptor instead.

func (*JoinChainRequest) GetChannel

func (x *JoinChainRequest) GetChannel() string

func (*JoinChainRequest) GetGenesisBlock

func (x *JoinChainRequest) GetGenesisBlock() *common.Block

func (*JoinChainRequest) ProtoMessage

func (*JoinChainRequest) ProtoMessage()

func (*JoinChainRequest) ProtoReflect

func (x *JoinChainRequest) ProtoReflect() protoreflect.Message

func (*JoinChainRequest) Reset

func (x *JoinChainRequest) Reset()

func (*JoinChainRequest) String

func (x *JoinChainRequest) String() string

func (*JoinChainRequest) Validate

func (m *JoinChainRequest) Validate() error

Validate checks the field values on JoinChainRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*JoinChainRequest) ValidateAll

func (m *JoinChainRequest) ValidateAll() error

ValidateAll checks the field values on JoinChainRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in JoinChainRequestMultiError, or nil if none found.

type JoinChainRequestMultiError

type JoinChainRequestMultiError []error

JoinChainRequestMultiError is an error wrapping multiple validation errors returned by JoinChainRequest.ValidateAll() if the designated constraints aren't met.

func (JoinChainRequestMultiError) AllErrors

func (m JoinChainRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (JoinChainRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type JoinChainRequestValidationError

type JoinChainRequestValidationError struct {
	// contains filtered or unexported fields
}

JoinChainRequestValidationError is the validation error returned by JoinChainRequest.Validate if the designated constraints aren't met.

func (JoinChainRequestValidationError) Cause

Cause function returns cause value.

func (JoinChainRequestValidationError) Error

Error satisfies the builtin error interface

func (JoinChainRequestValidationError) ErrorName

ErrorName returns error name.

func (JoinChainRequestValidationError) Field

Field function returns field value.

func (JoinChainRequestValidationError) Key

Key function returns key value.

func (JoinChainRequestValidationError) Reason

Reason function returns reason value.

type Service

type Service struct {
	UnimplementedCSCCServiceServer

	Querier           *tx.ProtoQuerier
	ChannelListGetter api.ChannelListGetter
	FabricVersion     hlfproto.FabricVersion
}

func FromClient

func FromClient(client api.Client) *Service

func NewCSCC

func NewCSCC(querier api.Querier, version hlfproto.FabricVersion) *Service

func (*Service) GetChannelConfig

func (c *Service) GetChannelConfig(ctx context.Context, request *GetChannelConfigRequest) (*common.Config, error)

func (*Service) GetChannels

func (c *Service) GetChannels(ctx context.Context, _ *empty.Empty) (*peer.ChannelQueryResponse, error)

func (*Service) GetConfigBlock

func (c *Service) GetConfigBlock(ctx context.Context, request *GetConfigBlockRequest) (*common.Block, error)

func (*Service) JoinChain

func (c *Service) JoinChain(ctx context.Context, request *JoinChainRequest) (*empty.Empty, error)

func (*Service) ServiceDef

func (c *Service) ServiceDef() *service.Def

type UnimplementedCSCCServiceServer

type UnimplementedCSCCServiceServer struct {
}

UnimplementedCSCCServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedCSCCServiceServer) GetChannelConfig

func (*UnimplementedCSCCServiceServer) GetChannels

func (*UnimplementedCSCCServiceServer) GetConfigBlock

func (*UnimplementedCSCCServiceServer) JoinChain

Jump to

Keyboard shortcuts

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