Documentation ¶
Overview ¶
Package service contains business logic of application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
ErrNotFound means that requested object is not found.
Functions ¶
This section is empty.
Types ¶
type PDVMeta ¶ added in v1.2.0
type PDVMeta struct { // ObjectTypes represents how much certain meta data meta contains. ObjectTypes map[schema.Type]uint16 `json:"object_types"` Reward uint64 `json:"reward"` }
PDVMeta contains info about PDV.
type Profile ¶ added in v1.2.0
type Profile struct { Address string FirstName string LastName string Emails []string Bio string Avatar string Gender string Birthday time.Time UpdatedAt *time.Time CreatedAt time.Time }
Profile ...
type Service ¶
type Service interface { // SavePDV sends PDV to storage. SavePDV(ctx context.Context, p schema.PDV, owner sdk.AccAddress) (uint64, PDVMeta, error) // ListPDV lists PDVs. ListPDV(ctx context.Context, owner string, from uint64, limit uint16) ([]uint64, error) // ReceivePDV returns slice of bytes of PDV requested by address from storage. ReceivePDV(ctx context.Context, owner string, id uint64) ([]byte, error) // GetPDVMeta returns PDVs meta. GetPDVMeta(ctx context.Context, owner string, id uint64) (PDVMeta, error) // GetProfile ... GetProfiles(ctx context.Context, owner []string) ([]*Profile, error) // GetRewardsMap ... GetRewardsMap() RewardMap }
Service interface provides service's logic's methods.
func New ¶
func New( c crypto.Crypto, fs storage.FileStorage, is storage.IndexStorage, b blockchain.Blockchain, rewardMap RewardMap, ) Service
New returns new instance of service.
Click to show internal directories.
Click to hide internal directories.