session

package
v1.22.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 11 Imported by: 21

Documentation

Index

Constants

View Source
const (
	// XHeaderNetmapEpoch is a key to the reserved X-header that specifies netmap epoch
	// to use for object placement calculation. If set to '0' or not set, the current
	// epoch only will be used.
	XHeaderNetmapEpoch = ReservedXHeaderPrefix + "NETMAP_EPOCH"

	// XHeaderNetmapLookupDepth is a key to the reserved X-header that limits
	// how many past epochs back the node will can lookup. If set to '0' or not
	// set, the current epoch only will be used.
	XHeaderNetmapLookupDepth = ReservedXHeaderPrefix + "NETMAP_LOOKUP_DEPTH"
)
View Source
const ReservedXHeaderPrefix = "__NEOFS__"

ReservedXHeaderPrefix is a prefix of keys to "well-known" X-headers.

Variables

This section is empty.

Functions

func CreateRequestBodyToGRPCMessage

func CreateRequestBodyToGRPCMessage(c *CreateRequestBody) *session.CreateRequest_Body

func CreateRequestToGRPCMessage

func CreateRequestToGRPCMessage(c *CreateRequest) *session.CreateRequest

func CreateResponseBodyToGRPCMessage

func CreateResponseBodyToGRPCMessage(c *CreateResponseBody) *session.CreateResponse_Body

func CreateResponseToGRPCMessage

func CreateResponseToGRPCMessage(c *CreateResponse) *session.CreateResponse

func ObjectSessionContextToGRPCMessage

func ObjectSessionContextToGRPCMessage(c *ObjectSessionContext) *session.ObjectSessionContext

func RequestHeadersFromGRPC

func RequestHeadersFromGRPC(
	src interface {
		GetMetaHeader() *session.RequestMetaHeader
		GetVerifyHeader() *session.RequestVerificationHeader
	},
	dst interface {
		SetMetaHeader(*RequestMetaHeader)
		SetVerificationHeader(*RequestVerificationHeader)
	},
)

func RequestHeadersToGRPC

func RequestHeadersToGRPC(
	src interface {
		GetMetaHeader() *RequestMetaHeader
		GetVerificationHeader() *RequestVerificationHeader
	},
	dst interface {
		SetMetaHeader(*session.RequestMetaHeader)
		SetVerifyHeader(*session.RequestVerificationHeader)
	},
)

func RequestMetaHeaderToGRPCMessage

func RequestMetaHeaderToGRPCMessage(r *RequestMetaHeader) *session.RequestMetaHeader

func ResponseHeadersFromGRPC

func ResponseHeadersFromGRPC(
	src interface {
		GetMetaHeader() *session.ResponseMetaHeader
		GetVerifyHeader() *session.ResponseVerificationHeader
	},
	dst interface {
		SetMetaHeader(*ResponseMetaHeader)
		SetVerificationHeader(*ResponseVerificationHeader)
	},
)

func ResponseHeadersToGRPC

func ResponseHeadersToGRPC(
	src interface {
		GetMetaHeader() *ResponseMetaHeader
		GetVerificationHeader() *ResponseVerificationHeader
	},
	dst interface {
		SetMetaHeader(*session.ResponseMetaHeader)
		SetVerifyHeader(*session.ResponseVerificationHeader)
	},
)

func ResponseMetaHeaderToGRPCMessage

func ResponseMetaHeaderToGRPCMessage(r *ResponseMetaHeader) *session.ResponseMetaHeader

func SessionTokenBodyToGRPCMessage

func SessionTokenBodyToGRPCMessage(t *SessionTokenBody) *session.SessionToken_Body

func SessionTokenToGRPCMessage

func SessionTokenToGRPCMessage(t *SessionToken) *session.SessionToken

func XHeaderToGRPCMessage

func XHeaderToGRPCMessage(x *XHeader) *session.XHeader

Types

type Client

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

Client represents universal session transport client.

func NewClient

func NewClient(opts ...Option) (*Client, error)

func (*Client) Create

func (c *Client) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error)

Create sends CreateRequest over the network and returns CreateResponse.

It returns any error encountered during the call.

type CreateRequest

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

func CreateRequestFromGRPCMessage

func CreateRequestFromGRPCMessage(m *session.CreateRequest) *CreateRequest

func (*CreateRequest) GetBody

func (c *CreateRequest) GetBody() *CreateRequestBody

func (*CreateRequest) GetMetaHeader

func (c *CreateRequest) GetMetaHeader() *RequestMetaHeader

func (*CreateRequest) GetVerificationHeader

func (c *CreateRequest) GetVerificationHeader() *RequestVerificationHeader

func (*CreateRequest) SetBody

func (c *CreateRequest) SetBody(v *CreateRequestBody)

func (*CreateRequest) SetMetaHeader

func (c *CreateRequest) SetMetaHeader(v *RequestMetaHeader)

func (*CreateRequest) SetVerificationHeader

func (c *CreateRequest) SetVerificationHeader(v *RequestVerificationHeader)

type CreateRequestBody

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

func CreateRequestBodyFromGRPCMessage

func CreateRequestBodyFromGRPCMessage(m *session.CreateRequest_Body) *CreateRequestBody

func (*CreateRequestBody) GetExpiration

func (c *CreateRequestBody) GetExpiration() uint64

func (*CreateRequestBody) GetOwnerID

func (c *CreateRequestBody) GetOwnerID() *refs.OwnerID

func (*CreateRequestBody) SetExpiration

func (c *CreateRequestBody) SetExpiration(v uint64)

func (*CreateRequestBody) SetOwnerID

func (c *CreateRequestBody) SetOwnerID(v *refs.OwnerID)

func (*CreateRequestBody) StableMarshal

func (c *CreateRequestBody) StableMarshal(buf []byte) ([]byte, error)

func (*CreateRequestBody) StableSize

func (c *CreateRequestBody) StableSize() (size int)

type CreateResponse

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

func CreateResponseFromGRPCMessage

func CreateResponseFromGRPCMessage(m *session.CreateResponse) *CreateResponse

func (*CreateResponse) GetBody

func (c *CreateResponse) GetBody() *CreateResponseBody

func (*CreateResponse) GetMetaHeader

func (c *CreateResponse) GetMetaHeader() *ResponseMetaHeader

func (*CreateResponse) GetVerificationHeader

func (c *CreateResponse) GetVerificationHeader() *ResponseVerificationHeader

func (*CreateResponse) SetBody

func (c *CreateResponse) SetBody(v *CreateResponseBody)

func (*CreateResponse) SetMetaHeader

func (c *CreateResponse) SetMetaHeader(v *ResponseMetaHeader)

func (*CreateResponse) SetVerificationHeader

func (c *CreateResponse) SetVerificationHeader(v *ResponseVerificationHeader)

type CreateResponseBody

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

func CreateResponseBodyFromGRPCMessage

func CreateResponseBodyFromGRPCMessage(m *session.CreateResponse_Body) *CreateResponseBody

func (*CreateResponseBody) GetID

func (c *CreateResponseBody) GetID() []byte

func (*CreateResponseBody) GetSessionKey

func (c *CreateResponseBody) GetSessionKey() []byte

func (*CreateResponseBody) SetID

func (c *CreateResponseBody) SetID(v []byte)

func (*CreateResponseBody) SetSessionKey

func (c *CreateResponseBody) SetSessionKey(v []byte)

func (*CreateResponseBody) StableMarshal

func (c *CreateResponseBody) StableMarshal(buf []byte) ([]byte, error)

func (*CreateResponseBody) StableSize

func (c *CreateResponseBody) StableSize() (size int)

type ObjectSessionContext

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

func ObjectSessionContextFromGRPCMessage

func ObjectSessionContextFromGRPCMessage(m *session.ObjectSessionContext) *ObjectSessionContext

func (*ObjectSessionContext) GetAddress

func (c *ObjectSessionContext) GetAddress() *refs.Address

func (*ObjectSessionContext) GetVerb

func (*ObjectSessionContext) MarshalJSON

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

func (*ObjectSessionContext) SetAddress

func (c *ObjectSessionContext) SetAddress(v *refs.Address)

func (*ObjectSessionContext) SetVerb

func (*ObjectSessionContext) StableMarshal

func (c *ObjectSessionContext) StableMarshal(buf []byte) ([]byte, error)

func (*ObjectSessionContext) StableSize

func (c *ObjectSessionContext) StableSize() (size int)

func (*ObjectSessionContext) Unmarshal

func (c *ObjectSessionContext) Unmarshal(data []byte) error

func (*ObjectSessionContext) UnmarshalJSON

func (c *ObjectSessionContext) UnmarshalJSON(data []byte) error

type ObjectSessionVerb

type ObjectSessionVerb uint32
const (
	ObjectVerbUnknown ObjectSessionVerb = iota
	ObjectVerbPut
	ObjectVerbGet
	ObjectVerbHead
	ObjectVerbSearch
	ObjectVerbDelete
	ObjectVerbRange
	ObjectVerbRangeHash
)

type Option

type Option func(*cfg)

Option represents Client option.

func WithGRPCCallOpts

func WithGRPCCallOpts(v []grpc.CallOption) Option

func WithGRPCClient

func WithGRPCClient(v *session.Client) Option

func WithGRPCClientOpts

func WithGRPCClientOpts(v []session.Option) Option

func WithGRPCServiceClient

func WithGRPCServiceClient(v session.SessionServiceClient) Option

func WithGlobalOpts

func WithGlobalOpts(v ...client.Option) Option

type RequestMetaHeader

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

func RequestMetaHeaderFromGRPCMessage

func RequestMetaHeaderFromGRPCMessage(m *session.RequestMetaHeader) *RequestMetaHeader

func (*RequestMetaHeader) GetBearerToken

func (r *RequestMetaHeader) GetBearerToken() *acl.BearerToken

func (*RequestMetaHeader) GetEpoch

func (r *RequestMetaHeader) GetEpoch() uint64

func (*RequestMetaHeader) GetOrigin

func (r *RequestMetaHeader) GetOrigin() *RequestMetaHeader

func (*RequestMetaHeader) GetSessionToken

func (r *RequestMetaHeader) GetSessionToken() *SessionToken

func (*RequestMetaHeader) GetTTL

func (r *RequestMetaHeader) GetTTL() uint32

func (*RequestMetaHeader) GetVersion

func (r *RequestMetaHeader) GetVersion() *refs.Version

func (*RequestMetaHeader) GetXHeaders

func (r *RequestMetaHeader) GetXHeaders() []*XHeader

func (*RequestMetaHeader) MarshalJSON

func (r *RequestMetaHeader) MarshalJSON() ([]byte, error)

func (*RequestMetaHeader) SetBearerToken

func (r *RequestMetaHeader) SetBearerToken(v *acl.BearerToken)

func (*RequestMetaHeader) SetEpoch

func (r *RequestMetaHeader) SetEpoch(v uint64)

func (*RequestMetaHeader) SetOrigin

func (r *RequestMetaHeader) SetOrigin(v *RequestMetaHeader)

func (*RequestMetaHeader) SetSessionToken

func (r *RequestMetaHeader) SetSessionToken(v *SessionToken)

func (*RequestMetaHeader) SetTTL

func (r *RequestMetaHeader) SetTTL(v uint32)

func (*RequestMetaHeader) SetVersion

func (r *RequestMetaHeader) SetVersion(v *refs.Version)

func (*RequestMetaHeader) SetXHeaders

func (r *RequestMetaHeader) SetXHeaders(v []*XHeader)

func (*RequestMetaHeader) StableMarshal

func (r *RequestMetaHeader) StableMarshal(buf []byte) ([]byte, error)

func (*RequestMetaHeader) StableSize

func (r *RequestMetaHeader) StableSize() (size int)

func (*RequestMetaHeader) Unmarshal

func (r *RequestMetaHeader) Unmarshal(data []byte) error

func (*RequestMetaHeader) UnmarshalJSON

func (r *RequestMetaHeader) UnmarshalJSON(data []byte) error

type RequestVerificationHeader

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

func (*RequestVerificationHeader) GetBodySignature

func (r *RequestVerificationHeader) GetBodySignature() *refs.Signature

func (*RequestVerificationHeader) GetMetaSignature

func (r *RequestVerificationHeader) GetMetaSignature() *refs.Signature

func (*RequestVerificationHeader) GetOrigin

func (*RequestVerificationHeader) GetOriginSignature

func (r *RequestVerificationHeader) GetOriginSignature() *refs.Signature

func (*RequestVerificationHeader) MarshalJSON

func (r *RequestVerificationHeader) MarshalJSON() ([]byte, error)

func (*RequestVerificationHeader) SetBodySignature

func (r *RequestVerificationHeader) SetBodySignature(v *refs.Signature)

func (*RequestVerificationHeader) SetMetaSignature

func (r *RequestVerificationHeader) SetMetaSignature(v *refs.Signature)

func (*RequestVerificationHeader) SetOrigin

func (*RequestVerificationHeader) SetOriginSignature

func (r *RequestVerificationHeader) SetOriginSignature(v *refs.Signature)

func (*RequestVerificationHeader) StableMarshal

func (r *RequestVerificationHeader) StableMarshal(buf []byte) ([]byte, error)

func (*RequestVerificationHeader) StableSize

func (r *RequestVerificationHeader) StableSize() (size int)

func (*RequestVerificationHeader) Unmarshal

func (r *RequestVerificationHeader) Unmarshal(data []byte) error

func (*RequestVerificationHeader) UnmarshalJSON

func (r *RequestVerificationHeader) UnmarshalJSON(data []byte) error

type ResponseMetaHeader

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

func ResponseMetaHeaderFromGRPCMessage

func ResponseMetaHeaderFromGRPCMessage(m *session.ResponseMetaHeader) *ResponseMetaHeader

func (*ResponseMetaHeader) GetEpoch

func (r *ResponseMetaHeader) GetEpoch() uint64

func (*ResponseMetaHeader) GetOrigin

func (r *ResponseMetaHeader) GetOrigin() *ResponseMetaHeader

func (*ResponseMetaHeader) GetTTL

func (r *ResponseMetaHeader) GetTTL() uint32

func (*ResponseMetaHeader) GetVersion

func (r *ResponseMetaHeader) GetVersion() *refs.Version

func (*ResponseMetaHeader) GetXHeaders

func (r *ResponseMetaHeader) GetXHeaders() []*XHeader

func (*ResponseMetaHeader) MarshalJSON

func (r *ResponseMetaHeader) MarshalJSON() ([]byte, error)

func (*ResponseMetaHeader) SetEpoch

func (r *ResponseMetaHeader) SetEpoch(v uint64)

func (*ResponseMetaHeader) SetOrigin

func (r *ResponseMetaHeader) SetOrigin(v *ResponseMetaHeader)

func (*ResponseMetaHeader) SetTTL

func (r *ResponseMetaHeader) SetTTL(v uint32)

func (*ResponseMetaHeader) SetVersion

func (r *ResponseMetaHeader) SetVersion(v *refs.Version)

func (*ResponseMetaHeader) SetXHeaders

func (r *ResponseMetaHeader) SetXHeaders(v []*XHeader)

func (*ResponseMetaHeader) StableMarshal

func (r *ResponseMetaHeader) StableMarshal(buf []byte) ([]byte, error)

func (*ResponseMetaHeader) StableSize

func (r *ResponseMetaHeader) StableSize() (size int)

func (*ResponseMetaHeader) Unmarshal

func (r *ResponseMetaHeader) Unmarshal(data []byte) error

func (*ResponseMetaHeader) UnmarshalJSON

func (r *ResponseMetaHeader) UnmarshalJSON(data []byte) error

type ResponseVerificationHeader

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

func (*ResponseVerificationHeader) GetBodySignature

func (r *ResponseVerificationHeader) GetBodySignature() *refs.Signature

func (*ResponseVerificationHeader) GetMetaSignature

func (r *ResponseVerificationHeader) GetMetaSignature() *refs.Signature

func (*ResponseVerificationHeader) GetOrigin

func (*ResponseVerificationHeader) GetOriginSignature

func (r *ResponseVerificationHeader) GetOriginSignature() *refs.Signature

func (*ResponseVerificationHeader) MarshalJSON

func (r *ResponseVerificationHeader) MarshalJSON() ([]byte, error)

func (*ResponseVerificationHeader) SetBodySignature

func (r *ResponseVerificationHeader) SetBodySignature(v *refs.Signature)

func (*ResponseVerificationHeader) SetMetaSignature

func (r *ResponseVerificationHeader) SetMetaSignature(v *refs.Signature)

func (*ResponseVerificationHeader) SetOrigin

func (*ResponseVerificationHeader) SetOriginSignature

func (r *ResponseVerificationHeader) SetOriginSignature(v *refs.Signature)

func (*ResponseVerificationHeader) StableMarshal

func (r *ResponseVerificationHeader) StableMarshal(buf []byte) ([]byte, error)

func (*ResponseVerificationHeader) StableSize

func (r *ResponseVerificationHeader) StableSize() (size int)

func (*ResponseVerificationHeader) Unmarshal

func (r *ResponseVerificationHeader) Unmarshal(data []byte) error

func (*ResponseVerificationHeader) UnmarshalJSON

func (r *ResponseVerificationHeader) UnmarshalJSON(data []byte) error

type Service

type Service interface {
	Create(context.Context, *CreateRequest) (*CreateResponse, error)
}

type SessionToken

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

func SessionTokenFromGRPCMessage

func SessionTokenFromGRPCMessage(m *session.SessionToken) *SessionToken

func (*SessionToken) GetBody

func (t *SessionToken) GetBody() *SessionTokenBody

func (*SessionToken) GetSignature

func (t *SessionToken) GetSignature() *refs.Signature

func (*SessionToken) MarshalJSON

func (t *SessionToken) MarshalJSON() ([]byte, error)

func (*SessionToken) SetBody

func (t *SessionToken) SetBody(v *SessionTokenBody)

func (*SessionToken) SetSignature

func (t *SessionToken) SetSignature(v *refs.Signature)

func (*SessionToken) StableMarshal

func (t *SessionToken) StableMarshal(buf []byte) ([]byte, error)

func (*SessionToken) StableSize

func (t *SessionToken) StableSize() (size int)

func (*SessionToken) Unmarshal

func (t *SessionToken) Unmarshal(data []byte) error

func (*SessionToken) UnmarshalJSON

func (t *SessionToken) UnmarshalJSON(data []byte) error

type SessionTokenBody

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

func SessionTokenBodyFromGRPCMessage

func SessionTokenBodyFromGRPCMessage(m *session.SessionToken_Body) *SessionTokenBody

func (*SessionTokenBody) GetContext

func (t *SessionTokenBody) GetContext() SessionTokenContext

func (*SessionTokenBody) GetID

func (t *SessionTokenBody) GetID() []byte

func (*SessionTokenBody) GetLifetime

func (t *SessionTokenBody) GetLifetime() *TokenLifetime

func (*SessionTokenBody) GetOwnerID

func (t *SessionTokenBody) GetOwnerID() *refs.OwnerID

func (*SessionTokenBody) GetSessionKey

func (t *SessionTokenBody) GetSessionKey() []byte

func (*SessionTokenBody) MarshalJSON

func (t *SessionTokenBody) MarshalJSON() ([]byte, error)

func (*SessionTokenBody) SetContext

func (t *SessionTokenBody) SetContext(v SessionTokenContext)

func (*SessionTokenBody) SetID

func (t *SessionTokenBody) SetID(v []byte)

func (*SessionTokenBody) SetLifetime

func (t *SessionTokenBody) SetLifetime(v *TokenLifetime)

func (*SessionTokenBody) SetOwnerID

func (t *SessionTokenBody) SetOwnerID(v *refs.OwnerID)

func (*SessionTokenBody) SetSessionKey

func (t *SessionTokenBody) SetSessionKey(v []byte)

func (*SessionTokenBody) StableMarshal

func (t *SessionTokenBody) StableMarshal(buf []byte) ([]byte, error)

func (*SessionTokenBody) StableSize

func (t *SessionTokenBody) StableSize() (size int)

func (*SessionTokenBody) Unmarshal

func (t *SessionTokenBody) Unmarshal(data []byte) error

func (*SessionTokenBody) UnmarshalJSON

func (t *SessionTokenBody) UnmarshalJSON(data []byte) error

type SessionTokenContext

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

type TokenLifetime

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

func (*TokenLifetime) GetExp

func (l *TokenLifetime) GetExp() uint64

func (*TokenLifetime) GetIat

func (l *TokenLifetime) GetIat() uint64

func (*TokenLifetime) GetNbf

func (l *TokenLifetime) GetNbf() uint64

func (*TokenLifetime) MarshalJSON

func (l *TokenLifetime) MarshalJSON() ([]byte, error)

func (*TokenLifetime) SetExp

func (l *TokenLifetime) SetExp(v uint64)

func (*TokenLifetime) SetIat

func (l *TokenLifetime) SetIat(v uint64)

func (*TokenLifetime) SetNbf

func (l *TokenLifetime) SetNbf(v uint64)

func (*TokenLifetime) StableMarshal

func (l *TokenLifetime) StableMarshal(buf []byte) ([]byte, error)

func (*TokenLifetime) StableSize

func (l *TokenLifetime) StableSize() (size int)

func (*TokenLifetime) Unmarshal

func (l *TokenLifetime) Unmarshal(data []byte) error

func (*TokenLifetime) UnmarshalJSON

func (l *TokenLifetime) UnmarshalJSON(data []byte) error

type XHeader

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

func XHeaderFromGRPCMessage

func XHeaderFromGRPCMessage(m *session.XHeader) *XHeader

func (*XHeader) GetKey

func (x *XHeader) GetKey() string

func (*XHeader) GetValue

func (x *XHeader) GetValue() string

func (*XHeader) MarshalJSON

func (x *XHeader) MarshalJSON() ([]byte, error)

func (*XHeader) SetKey

func (x *XHeader) SetKey(v string)

func (*XHeader) SetValue

func (x *XHeader) SetValue(v string)

func (*XHeader) StableMarshal

func (x *XHeader) StableMarshal(buf []byte) ([]byte, error)

func (*XHeader) StableSize

func (x *XHeader) StableSize() (size int)

func (*XHeader) Unmarshal

func (x *XHeader) Unmarshal(data []byte) error

func (*XHeader) UnmarshalJSON

func (x *XHeader) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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