Documentation ¶
Index ¶
- type ACLHandler
- type Account
- type BasicHandler
- func (h *BasicHandler) CurrentNonce(ctx *fiber.Ctx) error
- func (h *BasicHandler) Get(ctx *fiber.Ctx) error
- func (h *BasicHandler) GetDepositoryCertificate(ctx *fiber.Ctx) error
- func (h *BasicHandler) GetValue(ctx *fiber.Ctx) error
- func (h *BasicHandler) List(ctx *fiber.Ctx) error
- func (h *BasicHandler) PutUntrustValue(ctx *fiber.Ctx) error
- func (h *BasicHandler) PutValue(ctx *fiber.Ctx) error
- func (h *BasicHandler) Total(ctx *fiber.Ctx) error
- func (h *BasicHandler) VerifyValue(ctx *fiber.Ctx) error
- type HFHandler
- type KeyValue
- type MarketHandler
- type Metadata
- type Repository
- type Role
- type ValueDepository
- type VerifyStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACLHandler ¶
type ACLHandler struct {
// contains filtered or unexported fields
}
TODO: add all access control handlers
func NewACLHandler ¶
func NewACLHandler(acl *contracts.ACL) ACLHandler
func (*ACLHandler) HasRole ¶
func (handler *ACLHandler) HasRole(ctx *fiber.Ctx) error
type BasicHandler ¶
type BasicHandler struct {
// contains filtered or unexported fields
}
func NewBasicHandler ¶
func NewBasicHandler(contractClient *contracts.Depository, h depositories.Interface) BasicHandler
func (*BasicHandler) CurrentNonce ¶
func (h *BasicHandler) CurrentNonce(ctx *fiber.Ctx) error
func (*BasicHandler) Get ¶
func (h *BasicHandler) Get(ctx *fiber.Ctx) error
func (*BasicHandler) GetDepositoryCertificate ¶
func (h *BasicHandler) GetDepositoryCertificate(ctx *fiber.Ctx) error
func (*BasicHandler) GetValue ¶
func (h *BasicHandler) GetValue(ctx *fiber.Ctx) error
func (*BasicHandler) List ¶
func (h *BasicHandler) List(ctx *fiber.Ctx) error
func (*BasicHandler) PutUntrustValue ¶
func (h *BasicHandler) PutUntrustValue(ctx *fiber.Ctx) error
func (*BasicHandler) PutValue ¶
func (h *BasicHandler) PutValue(ctx *fiber.Ctx) error
func (*BasicHandler) VerifyValue ¶
func (h *BasicHandler) VerifyValue(ctx *fiber.Ctx) error
type HFHandler ¶
type HFHandler struct {
// contains filtered or unexported fields
}
func NewHyperledgerHandler ¶
func NewHyperledgerHandler(hf *contracts.Hyperledger) HFHandler
func (*HFHandler) GetMetadata ¶
type KeyValue ¶
type KeyValue struct { Index string `json:"index,omitempty"` KID string `json:"kid,omitempty"` Value string `json:"value,omitempty"` // Message is a base64 encoded string of utils.Message Message string `json:"message,omitempty"` }
KeyValue defines common key-value fields for a depository
type MarketHandler ¶
type MarketHandler struct {
// contains filtered or unexported fields
}
func NewMarketHandler ¶
func NewMarketHandler(contractClient *contracts.Market) *MarketHandler
NewMarketHandler creates a new instance of MarketHandler.
It takes a pointer to a Market contract and returns a pointer to a MarketHandler.
func (*MarketHandler) CreateRepo ¶
func (lh *MarketHandler) CreateRepo(ctx *fiber.Ctx) error
CreateRepo creates a new repository with a market in the given URL.
ctx: Context from the request. Returns an error if there is a bad request or internal server error.
func (*MarketHandler) CurrentNonce ¶
func (lh *MarketHandler) CurrentNonce(ctx *fiber.Ctx) error
CurrentNonce returns the current nonce for the given account.
func (*MarketHandler) GetRepos ¶
func (lh *MarketHandler) GetRepos(ctx *fiber.Ctx) error
GetRepos returns a list of repositories from the MarketHandler's market instance
func (*MarketHandler) UpdateRepo ¶
func (lh *MarketHandler) UpdateRepo(ctx *fiber.Ctx) error
UpdateRepo updates the repository with the given ID and URL. It expects a JSON-encoded body containing a Repository object. Returns a JSON response with the updated repository ID and URL.
type Repository ¶
type Repository struct { ID string `json:"id"` // URL of this repository URL string `json:"url,omitempty"` // Message is a base64 encoded string of utils.Message Message string `json:"message,omitempty"` }
KeyValue defines common key-value fields for a depository
type ValueDepository ¶
type ValueDepository struct { Name string `json:"name"` ContentName string `json:"contentName"` ContentType string `json:"contentType"` ContentID string `json:"contentID"` // hash of the file // ContentSize the size of file. unit is byte ContentSize int64 `json:"contentSize"` TrustedTimestamp string `json:"trustedTimestamp"` Platform string `json:"platform"` Description string `json:"description,omitempty"` }
ValueDepository defines valuable fields for a depository
type VerifyStatus ¶
VerifyStatus defines response fields for a depository verification