accounting

package
v2.0.0-...-196241c Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccountingService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "neo.fs.v2.accounting.AccountingService",
	HandlerType: (*AccountingServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Balance",
			Handler:    _AccountingService_Balance_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "accounting/grpc/service.proto",
}

AccountingService_ServiceDesc is the grpc.ServiceDesc for AccountingService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_accounting_grpc_service_proto protoreflect.FileDescriptor
View Source
var File_accounting_grpc_types_proto protoreflect.FileDescriptor

Functions

func RegisterAccountingServiceServer

func RegisterAccountingServiceServer(s grpc.ServiceRegistrar, srv AccountingServiceServer)

Types

type AccountingServiceClient

type AccountingServiceClient interface {
	// Returns the amount of funds in GAS token for the requested NeoFS account.
	//
	// Statuses:
	// - **OK** (0, SECTION_SUCCESS):
	// balance has been successfully read;
	// - Common failures (SECTION_FAILURE_COMMON).
	Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error)
}

AccountingServiceClient is the client API for AccountingService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type AccountingServiceServer

type AccountingServiceServer interface {
	// Returns the amount of funds in GAS token for the requested NeoFS account.
	//
	// Statuses:
	// - **OK** (0, SECTION_SUCCESS):
	// balance has been successfully read;
	// - Common failures (SECTION_FAILURE_COMMON).
	Balance(context.Context, *BalanceRequest) (*BalanceResponse, error)
}

AccountingServiceServer is the server API for AccountingService service. All implementations should embed UnimplementedAccountingServiceServer for forward compatibility

type BalanceRequest

type BalanceRequest struct {

	// Body of the balance request message.
	Body *BalanceRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
	// Carries request meta information. Header data is used only to regulate
	// message transport and does not affect request execution.
	MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"`
	// Carries request verification information. This header is used to
	// authenticate the nodes of the message route and check the correctness of
	// transmission.
	VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"`
	// contains filtered or unexported fields
}

BalanceRequest message

func (*BalanceRequest) Descriptor deprecated

func (*BalanceRequest) Descriptor() ([]byte, []int)

Deprecated: Use BalanceRequest.ProtoReflect.Descriptor instead.

func (*BalanceRequest) GetBody

func (x *BalanceRequest) GetBody() *BalanceRequest_Body

func (*BalanceRequest) GetMetaHeader

func (x *BalanceRequest) GetMetaHeader() *grpc.RequestMetaHeader

func (*BalanceRequest) GetVerifyHeader

func (x *BalanceRequest) GetVerifyHeader() *grpc.RequestVerificationHeader

func (*BalanceRequest) ProtoMessage

func (*BalanceRequest) ProtoMessage()

func (*BalanceRequest) ProtoReflect

func (x *BalanceRequest) ProtoReflect() protoreflect.Message

func (*BalanceRequest) Reset

func (x *BalanceRequest) Reset()

func (*BalanceRequest) SetBody

func (m *BalanceRequest) SetBody(v *BalanceRequest_Body)

SetBody sets body of the request.

func (*BalanceRequest) SetMetaHeader

func (m *BalanceRequest) SetMetaHeader(v *session.RequestMetaHeader)

SetMetaHeader sets meta header of the request.

func (*BalanceRequest) SetVerifyHeader

func (m *BalanceRequest) SetVerifyHeader(v *session.RequestVerificationHeader)

SetVerifyHeader sets verification header of the request.

func (*BalanceRequest) String

func (x *BalanceRequest) String() string

type BalanceRequest_Body

type BalanceRequest_Body struct {

	// Valid user identifier in `OwnerID` format for which the balance is
	// requested. Required field.
	OwnerId *grpc1.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"`
	// contains filtered or unexported fields
}

To indicate the account for which the balance is requested, its identifier is used. It can be any existing account in NeoFS sidechain `Balance` smart contract. If omitted, client implementation MUST set it to the request's signer `OwnerID`.

func (*BalanceRequest_Body) Descriptor deprecated

func (*BalanceRequest_Body) Descriptor() ([]byte, []int)

Deprecated: Use BalanceRequest_Body.ProtoReflect.Descriptor instead.

func (*BalanceRequest_Body) GetOwnerId

func (x *BalanceRequest_Body) GetOwnerId() *grpc1.OwnerID

func (*BalanceRequest_Body) ProtoMessage

func (*BalanceRequest_Body) ProtoMessage()

func (*BalanceRequest_Body) ProtoReflect

func (x *BalanceRequest_Body) ProtoReflect() protoreflect.Message

func (*BalanceRequest_Body) Reset

func (x *BalanceRequest_Body) Reset()

func (*BalanceRequest_Body) SetOwnerId

func (m *BalanceRequest_Body) SetOwnerId(v *refs.OwnerID)

SetOwnerId sets identifier of the account owner.

func (*BalanceRequest_Body) String

func (x *BalanceRequest_Body) String() string

type BalanceResponse

type BalanceResponse struct {

	// Body of the balance response message.
	Body *BalanceResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
	// Carries response meta information. Header data is used only to regulate
	// message transport and does not affect request execution.
	MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"`
	// Carries response verification information. This header is used to
	// authenticate the nodes of the message route and check the correctness of
	// transmission.
	VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"`
	// contains filtered or unexported fields
}

BalanceResponse message

func (*BalanceResponse) Descriptor deprecated

func (*BalanceResponse) Descriptor() ([]byte, []int)

Deprecated: Use BalanceResponse.ProtoReflect.Descriptor instead.

func (*BalanceResponse) GetBody

func (x *BalanceResponse) GetBody() *BalanceResponse_Body

func (*BalanceResponse) GetMetaHeader

func (x *BalanceResponse) GetMetaHeader() *grpc.ResponseMetaHeader

func (*BalanceResponse) GetVerifyHeader

func (x *BalanceResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader

func (*BalanceResponse) ProtoMessage

func (*BalanceResponse) ProtoMessage()

func (*BalanceResponse) ProtoReflect

func (x *BalanceResponse) ProtoReflect() protoreflect.Message

func (*BalanceResponse) Reset

func (x *BalanceResponse) Reset()

func (*BalanceResponse) SetBody

func (m *BalanceResponse) SetBody(v *BalanceResponse_Body)

SetBody sets body of the response.

func (*BalanceResponse) SetMetaHeader

func (m *BalanceResponse) SetMetaHeader(v *session.ResponseMetaHeader)

SetMetaHeader sets meta header of the response.

func (*BalanceResponse) SetVerifyHeader

func (m *BalanceResponse) SetVerifyHeader(v *session.ResponseVerificationHeader)

SetVerifyHeader sets verification header of the response.

func (*BalanceResponse) String

func (x *BalanceResponse) String() string

type BalanceResponse_Body

type BalanceResponse_Body struct {

	// Amount of funds in GAS token for the requested account.
	Balance *Decimal `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"`
	// contains filtered or unexported fields
}

The amount of funds in GAS token for the `OwnerID`'s account requested. Balance is given in the `Decimal` format to avoid precision issues with rounding.

func (*BalanceResponse_Body) Descriptor deprecated

func (*BalanceResponse_Body) Descriptor() ([]byte, []int)

Deprecated: Use BalanceResponse_Body.ProtoReflect.Descriptor instead.

func (*BalanceResponse_Body) GetBalance

func (x *BalanceResponse_Body) GetBalance() *Decimal

func (*BalanceResponse_Body) ProtoMessage

func (*BalanceResponse_Body) ProtoMessage()

func (*BalanceResponse_Body) ProtoReflect

func (x *BalanceResponse_Body) ProtoReflect() protoreflect.Message

func (*BalanceResponse_Body) Reset

func (x *BalanceResponse_Body) Reset()

func (*BalanceResponse_Body) SetBalance

func (m *BalanceResponse_Body) SetBalance(v *Decimal)

SetBalance sets balance value of the response.

func (*BalanceResponse_Body) String

func (x *BalanceResponse_Body) String() string

type Decimal

type Decimal struct {

	// Number in the smallest Token fractions.
	Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
	// Precision value indicating how many smallest fractions can be in one
	// integer.
	Precision uint32 `protobuf:"varint,2,opt,name=precision,proto3" json:"precision,omitempty"`
	// contains filtered or unexported fields
}

Standard floating point data type can't be used in NeoFS due to inexactness of the result when doing lots of small number operations. To solve the lost precision issue, special `Decimal` format is used for monetary computations.

Please see [The General Decimal Arithmetic Specification](http://speleotrove.com/decimal/) for detailed problem description.

func (*Decimal) Descriptor deprecated

func (*Decimal) Descriptor() ([]byte, []int)

Deprecated: Use Decimal.ProtoReflect.Descriptor instead.

func (*Decimal) GetPrecision

func (x *Decimal) GetPrecision() uint32

func (*Decimal) GetValue

func (x *Decimal) GetValue() int64

func (*Decimal) ProtoMessage

func (*Decimal) ProtoMessage()

func (*Decimal) ProtoReflect

func (x *Decimal) ProtoReflect() protoreflect.Message

func (*Decimal) Reset

func (x *Decimal) Reset()

func (*Decimal) SetPrecision

func (m *Decimal) SetPrecision(v uint32)

SetPrecision sets precision of the decimal number.

func (*Decimal) SetValue

func (m *Decimal) SetValue(v int64)

SetValue sets value of the decimal number.

func (*Decimal) String

func (x *Decimal) String() string

type UnimplementedAccountingServiceServer

type UnimplementedAccountingServiceServer struct {
}

UnimplementedAccountingServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedAccountingServiceServer) Balance

type UnsafeAccountingServiceServer

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

UnsafeAccountingServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AccountingServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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