http

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 39 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIncorrectType = errors.New("incorrect response type")

ErrIncorrectType is returned when the multi client obtain a response type it is not expecting.

Functions

func New

func New(ctx context.Context, params ...Parameter) (builderclient.Service, error)

New creates a new builder client service, connecting with HTTP.

Types

type ContentType

type ContentType int

ContentType defines the builder spec version.

const (
	// ContentTypeUnknown implies an unknown content type.
	ContentTypeUnknown ContentType = iota
	// ContentTypeSSZ implies an SSZ content type.
	ContentTypeSSZ
	// ContentTypeJSON implies a JSON content type.
	ContentTypeJSON
)

func ParseFromMediaType

func ParseFromMediaType(input string) (ContentType, error)

ParseFromMediaType parses a content type string as per http://www.iana.org/assignments/media-types/media-types.xhtml

func (*ContentType) MarshalJSON

func (c *ContentType) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (ContentType) MediaType

func (c ContentType) MediaType() string

MediaType returns the IANA name of the media type.

func (ContentType) String

func (c ContentType) String() string

String returns a string representation of the type.

func (*ContentType) UnmarshalJSON

func (c *ContentType) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Parameter

type Parameter interface {
	// contains filtered or unexported methods
}

Parameter is the interface for service parameters.

func WithAddress

func WithAddress(address string) Parameter

WithAddress provides the address for the endpoint.

func WithExtraHeaders added in v0.3.1

func WithExtraHeaders(headers map[string]string) Parameter

WithExtraHeaders sets additional headers to be sent with each HTTP request.

func WithLogLevel

func WithLogLevel(logLevel zerolog.Level) Parameter

WithLogLevel sets the log level for the module.

func WithMonitor

func WithMonitor(monitor metrics.Service) Parameter

WithMonitor sets the monitor for the module.

func WithTimeout

func WithTimeout(timeout time.Duration) Parameter

WithTimeout sets the maximum duration for all requests to the endpoint.

type Service

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

Service is a builder client service.

func (*Service) Address

func (s *Service) Address() string

Address provides the address for the connection.

func (*Service) BuilderBid

func (s *Service) BuilderBid(ctx context.Context,
	slot phase0.Slot,
	parentHash phase0.Hash32,
	pubKey phase0.BLSPubKey,
) (
	*spec.VersionedSignedBuilderBid,
	error,
)

BuilderBid obtains a builder bid.

func (*Service) Name

func (s *Service) Name() string

Name provides the name of the service.

func (*Service) Pubkey added in v0.1.5

func (s *Service) Pubkey() *phase0.BLSPubKey

Pubkey returns the public key of the builder (if any).

func (*Service) SubmitValidatorRegistrations

func (s *Service) SubmitValidatorRegistrations(ctx context.Context,
	registrations []*api.VersionedSignedValidatorRegistration,
) error

SubmitValidatorRegistrations submits a validator registration.

func (*Service) UnblindBlock deprecated

UnblindBlock unblinds a block.

Deprecated: this will not work from the deneb hard-fork onwards. Use UnblindProposal() instead.

func (*Service) UnblindProposal added in v0.4.0

UnblindProposal unblinds a proposal.

Jump to

Keyboard shortcuts

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