{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package deliver\n\n## Functions\n\n```go\nfunc ExtractChannelHeaderCertHash(msg proto.Message) []byte\n```\nExtractChannelHeaderCertHash extracts the TLS cert hash from a channel header.\n\n## Types\n\n```go\ntype Chain interface {\n\t// Sequence returns the current config sequence number, can be used to detect config changes\n\tSequence() uint64\n\n\t// PolicyManager returns the current policy manager as specified by the chain configuration\n\tPolicyManager() policies.Manager\n\n\t// Reader returns the chain Reader for the chain\n\tReader() blockledger.Reader\n\n\t// Errored returns a channel which closes when the backing consenter has errored\n\tErrored() \u003c-chan struct{}\n}\n```\nChain encapsulates chain operations and data.\n\n```go\ntype ChainManager interface {\n\tGetChain(chainID string) Chain\n}\n```\nChainManager provides a way for the Handler to look up the Chain.\n\n```go\ntype ConfigSequencer interface {\n\tSequence() uint64\n}\n```\nConfigSequencer provides the sequence number of the current config block.\n\n```go\ntype ExpiresAtFunc func(identityBytes []byte) time.Time\n```\nExpiresAtFunc is used to extract the time at which an identity expires.\n\n```go\ntype Filtered interface {\n\tIsFiltered() bool\n}\n```\nFiltered is a marker interface that indicates a response sender is configured to send filtered blocks\n\n```go\ntype Handler struct {\n\tExpirationCheckFunc func(identityBytes []byte) time.Time\n\tChainManager        ChainManager\n\tTimeWindow          time.Duration\n\tBindingInspector    Inspector\n\tMetrics             *Metrics\n}\n```\nHandler handles server requests.\n\n```go\nfunc NewHandler(cm ChainManager, timeWindow time.Duration, mutualTLS bool, metrics *Metrics, expirationCheckDisabled bool) *Handler\n```\nNewHandler creates an implementation of the Handler interface.\n\n```go\nfunc (h *Handler) Handle(ctx context.Context, srv *Server) error\n```\nHandle receives incoming deliver requests.\n\n```go\ntype Inspector interface {\n\tInspect(context.Context, proto.Message) error\n}\n```\nInspector verifies an appropriate binding between the message and the context.\n\n```go\ntype InspectorFunc func(context.Context, proto.Message) error\n```\nThe InspectorFunc is an adapter that allows the use of an ordinary function as an Inspector.\n\n```go\nfunc (inspector InspectorFunc) Inspect(ctx context.Context, p proto.Message) error\n```\nInspect calls inspector(ctx, p)\n\n```go\ntype Metrics struct {\n\tStreamsOpened     metrics.Counter\n\tStreamsClosed     metrics.Counter\n\tRequestsReceived  metrics.Counter\n\tRequestsCompleted metrics.Counter\n\tBlocksSent        metrics.Counter\n}\n```\n\n```go\nfunc NewMetrics(p metrics.Provider) *Metrics\n```\n\n```go\ntype PolicyChecker interface {\n\tCheckPolicy(envelope *cb.Envelope, channelID string) error\n}\n```\nPolicyChecker checks the envelope against the policy logic supplied by the function.\n\n```go\ntype PolicyCheckerFunc func(envelope *cb.Envelope, channelID string) error\n```\nThe PolicyCheckerFunc is an adapter that allows the use of an ordinary function as a PolicyChecker.\n\n```go\nfunc (pcf PolicyCheckerFunc) CheckPolicy(envelope *cb.Envelope, channelID string) error\n```\nCheckPolicy calls pcf(envelope, channelID)\n\n```go\ntype Receiver interface {\n\tRecv() (*cb.Envelope, error)\n}\n```\nReceiver is used to receive enveloped seek requests.\n\n```go\ntype ResponseSender interface {\n\tSendStatusResponse(status cb.Status) error\n\tSendBlockResponse(block *cb.Block) error\n}\n```\nResponseSender defines the interface a handler must implement to send responses.\n\n```go\ntype Server struct {\n\tReceiver\n\tPolicyChecker\n\tResponseSender\n}\n```\nServer is a polymorphic structure to support generalization of this handler to be able to deliver different type of responses.\n\n```go\ntype SessionAccessControl struct {\n\t// contains filtered or unexported fields\n}\n```\nSessionAccessControl holds access control related data for a common Envelope that is used to determine if a request is allowed for the identity associated with the request envelope.\n\n```go\nfunc NewSessionAC(chain ConfigSequencer, env *common.Envelope, policyChecker PolicyChecker, channelID string, expiresAt ExpiresAtFunc) (*SessionAccessControl, error)\n```\nNewSessionAC creates an instance of SessionAccessControl. This constructor will return an error if a signature header cannot be extracted from the envelope.\n\n```go\nfunc (ac *SessionAccessControl) Evaluate() error\n```\nEvaluate uses the PolicyChecker to determine if a request should be allowed. The decision is cached until the identity expires or the chain configuration changes.\n\n","path":"github.com/eric-erki/https-hyperledger.org/common/deliver","name":"deliver","synopsis":"","isRedistributable":true}
