client

package
v0.27.5 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWrongPublicKey = errors.New("public key is different from the key in the network map")

ErrWrongPublicKey is returned when the client's response is signed with a key different from the one declared in the network map.

Functions

func AssertKeyResponseCallback added in v0.26.0

func AssertKeyResponseCallback(expectedKey []byte) func(client.ResponseMetaInfo) error

AssertKeyResponseCallback returns client response callback which checks if the response was signed by expected key. Returns ErrWrongPublicKey in case of key mismatch.

func NodeInfoFromNetmapElement added in v0.26.0

func NodeInfoFromNetmapElement(dst *NodeInfo, info interface {
	PublicKey() []byte
	Addresses() network.AddressGroup
})

NodeInfoFromNetmapElement fills NodeInfo structure from the interface of parsed netmap member's descriptor.

Args must not be nil.

func NodeInfoFromRawNetmapElement added in v0.26.0

func NodeInfoFromRawNetmapElement(dst *NodeInfo, info interface {
	PublicKey() []byte
	IterateAddresses(func(string) bool)
	NumberOfAddresses() int
}) error

NodeInfoFromRawNetmapElement fills NodeInfo structure from the interface of raw netmap member's descriptor.

Args must not be nil.

Types

type Client

type Client interface {
	GetBalance(context.Context, *owner.ID, ...client.CallOption) (*client.BalanceOfRes, error)

	PutContainer(context.Context, *container.Container, ...client.CallOption) (*client.ContainerPutRes, error)
	GetContainer(context.Context, *cid.ID, ...client.CallOption) (*client.ContainerGetRes, error)
	ListContainers(context.Context, *owner.ID, ...client.CallOption) (*client.ContainerListRes, error)
	DeleteContainer(context.Context, *cid.ID, ...client.CallOption) (*client.ContainerDeleteRes, error)

	EACL(context.Context, *cid.ID, ...client.CallOption) (*client.EACLRes, error)
	SetEACL(context.Context, *eacl.Table, ...client.CallOption) (*client.SetEACLRes, error)

	AnnounceContainerUsedSpace(context.Context, []container.UsedSpaceAnnouncement, ...client.CallOption) (*client.AnnounceSpaceRes, error)

	EndpointInfo(context.Context, ...client.CallOption) (*client.EndpointInfoRes, error)
	NetworkInfo(context.Context, ...client.CallOption) (*client.NetworkInfoRes, error)

	PutObject(context.Context, *client.PutObjectParams, ...client.CallOption) (*client.ObjectPutRes, error)
	DeleteObject(context.Context, *client.DeleteObjectParams, ...client.CallOption) (*client.ObjectDeleteRes, error)
	GetObject(context.Context, *client.GetObjectParams, ...client.CallOption) (*client.ObjectGetRes, error)
	HeadObject(context.Context, *client.ObjectHeaderParams, ...client.CallOption) (*client.ObjectHeadRes, error)
	SearchObjects(context.Context, *client.SearchObjectParams, ...client.CallOption) (*client.ObjectSearchRes, error)
	ObjectPayloadRangeData(context.Context, *client.RangeDataParams, ...client.CallOption) (*client.ObjectRangeRes, error)
	HashObjectPayloadRanges(context.Context, *client.RangeChecksumParams, ...client.CallOption) (*client.ObjectRangeHashRes, error)

	AnnounceLocalTrust(context.Context, client.AnnounceLocalTrustPrm, ...client.CallOption) (*client.AnnounceLocalTrustRes, error)
	AnnounceIntermediateTrust(context.Context, client.AnnounceIntermediateTrustPrm, ...client.CallOption) (*client.AnnounceIntermediateTrustRes, error)

	CreateSession(context.Context, uint64, ...client.CallOption) (*client.CreateSessionRes, error)

	Raw() *rawclient.Client

	Conn() io.Closer
}

Client is an interface of NeoFS storage node's client.

type MultiAddressClient added in v0.27.5

type MultiAddressClient interface {
	Client

	// RawForAddress must return rawclient.Client
	// for the passed network.Address.
	RawForAddress(network.Address) *rawclient.Client
}

MultiAddressClient is an interface of the Client that supports multihost work.

type NodeInfo added in v0.26.0

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

NodeInfo groups information about NeoFS storage node needed for Client construction.

func (NodeInfo) AddressGroup added in v0.26.0

func (x NodeInfo) AddressGroup() network.AddressGroup

AddressGroup returns group of network addresses.

func (*NodeInfo) PublicKey added in v0.26.0

func (x *NodeInfo) PublicKey() []byte

PublicKey returns public key in a binary format.

Result must not be mutated.

func (*NodeInfo) SetAddressGroup added in v0.26.0

func (x *NodeInfo) SetAddressGroup(v network.AddressGroup)

SetAddressGroup sets group of network addresses.

func (*NodeInfo) SetPublicKey added in v0.26.0

func (x *NodeInfo) SetPublicKey(v []byte)

SetPublicKey sets public key in a binary format.

Argument must not be mutated.

Jump to

Keyboard shortcuts

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