util

package
v0.42.0-rc.7 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAbortStream = errors.New("abort message stream")

Functions

func EnsureNonNilResponse added in v0.37.0

func EnsureNonNilResponse[T any](resp *T, err error) (*T, error)

EnsureNonNilResponse creates an appropriate response struct if it is nil.

Types

type RequestMessage

type RequestMessage interface {
	GetMetaHeader() *session.RequestMetaHeader
}

type ResponseMessage

type ResponseMessage interface {
	GetMetaHeader() *session.ResponseMetaHeader
	SetMetaHeader(*session.ResponseMetaHeader)
}

ResponseMessage is an interface of FrostFS response message.

type ServerStream

type ServerStream interface {
	Context() context.Context
}

ServerStream is an interface of server-side stream v2.

type SignService

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

func NewUnarySignService

func NewUnarySignService(key *ecdsa.PrivateKey) *SignService

func (*SignService) SignResponse added in v0.37.0

func (s *SignService) SignResponse(resp ResponseMessage, err error) error

SignResponse response with private key via signature.SignServiceMessage. The signature error affects the result depending on the protocol version:

  • if status return is supported, panics since we cannot return the failed status, because it will not be signed.
  • otherwise, returns error in order to transport it directly.

func (*SignService) VerifyRequest added in v0.37.0

func (s *SignService) VerifyRequest(req RequestMessage) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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