Documentation ¶
Index ¶
- func CORSMiddleware(r *mux.Router) mux.MiddlewareFunc
- func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error
- func Logger(inner http.Handler, name string) http.Handler
- func NewRouter(routers ...Router) *mux.Router
- func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error)
- func ReadFormFilesToTempFiles(r *http.Request, key string) ([]*os.File, error)
- type Attribution
- type CardanoTip
- type CardanoTransaction
- type Commission
- type DefaultApiController
- func (c *DefaultApiController) GetCardanoTip(w http.ResponseWriter, r *http.Request)
- func (c *DefaultApiController) GetOrders(w http.ResponseWriter, r *http.Request)
- func (c *DefaultApiController) GetProducts(w http.ResponseWriter, r *http.Request)
- func (c *DefaultApiController) GetStatus(w http.ResponseWriter, r *http.Request)
- func (c *DefaultApiController) GetWallet(w http.ResponseWriter, r *http.Request)
- func (c *DefaultApiController) GetWorkflowMinterNvla(w http.ResponseWriter, r *http.Request)
- func (c *DefaultApiController) PostCardanoTransaction(w http.ResponseWriter, r *http.Request)
- func (c *DefaultApiController) PostOrders(w http.ResponseWriter, r *http.Request)
- func (c *DefaultApiController) PostProducts(w http.ResponseWriter, r *http.Request)
- func (c *DefaultApiController) PostWorkflowMinterNvla(w http.ResponseWriter, r *http.Request)
- func (c *DefaultApiController) Routes() Routes
- type DefaultApiRouter
- type DefaultApiService
- func (s *DefaultApiService) GetCardanoTip(ctx context.Context) (ImplResponse, error)
- func (s *DefaultApiService) GetOrders(ctx context.Context, orderId string) (ImplResponse, error)
- func (s *DefaultApiService) GetProducts(ctx context.Context, marketId string, organizationId string) (ImplResponse, error)
- func (s *DefaultApiService) GetStatus(ctx context.Context) (ImplResponse, error)
- func (s *DefaultApiService) GetWallet(ctx context.Context, walletAddress string) (ImplResponse, error)
- func (s *DefaultApiService) GetWorkflowMinterNvla(ctx context.Context) (ImplResponse, error)
- func (s *DefaultApiService) PostCardanoTransaction(ctx context.Context, cardanoTransaction CardanoTransaction) (ImplResponse, error)
- func (s *DefaultApiService) PostOrders(ctx context.Context, order Order) (ImplResponse, error)
- func (s *DefaultApiService) PostProducts(ctx context.Context, productsList ProductsList) (ImplResponse, error)
- func (s *DefaultApiService) PostWorkflowMinterNvla(ctx context.Context, minterInfo MinterInfo) (ImplResponse, error)
- type DefaultApiServicer
- type DescriptionSet
- type Extended721Token
- type ImplResponse
- type MinterInfo
- type NativeToken
- type NovelliaProduct
- type NovelliaStandardToken
- type OccultaNovelliaCharacter
- type OccultaNovelliaCharacterCard
- type OccultaNovelliaCharacterProgression
- type OccultaNovelliaCharacterStats
- type OffChainResource
- type Order
- type OrderCreated
- type OrderCustomer
- type OrderItems
- type OrderPayment
- type Product
- type ProductMarket
- type ProductMetadata
- type ProductOrganization
- type ProductPricing
- type ProductProduct
- type ProductStock
- type ProductsList
- type Route
- type Router
- type Routes
- type Status
- type StatusCardano
- type Token
- type WorkflowInformation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORSMiddleware ¶
func CORSMiddleware(r *mux.Router) mux.MiddlewareFunc
func EncodeJSONResponse ¶
func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error
EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code
func ReadFormFileToTempFile ¶
ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file
Types ¶
type Attribution ¶
type Attribution struct { // Name to give attribution to AuthorName string `json:"author_name"` // URLs to portfolios, websites, etc. Url []string `json:"url"` // Description of work attributed WorkAttributed string `json:"work_attributed"` }
Attribution - Attribution information for artist, sculptor, whoever.
type CardanoTip ¶
type CardanoTip struct { // Latest Cardano block Block int32 `json:"block"` // Latest Cardano epoch Epoch int32 `json:"epoch"` }
CardanoTip - Cardano chain tip information
type CardanoTransaction ¶
type CardanoTransaction struct { // text of transaction file Transaction string `json:"transaction"` // Cost to submit TX in lovelace (1 ADA = 1,000,000 lovelace) FeeLovelace int32 `json:"fee_lovelace"` // Indicates if the transaction is signed or raw Signed bool `json:"signed"` }
CardanoTransaction - A Cardano transaction to be signed and submitted.
type Commission ¶
type Commission struct { // Name of entity taking commissions Name string `json:"name"` // Address to deposit commissions Address string `json:"address"` // Recommended commission percentage Percent float32 `json:"percent,omitempty"` }
Commission - A recommended commission for clients that will abide by it
type DefaultApiController ¶
type DefaultApiController struct {
// contains filtered or unexported fields
}
A DefaultApiController binds http requests to an api service and writes the service results to the http response
func (*DefaultApiController) GetCardanoTip ¶
func (c *DefaultApiController) GetCardanoTip(w http.ResponseWriter, r *http.Request)
GetCardanoTip - Your GET endpoint
func (*DefaultApiController) GetOrders ¶
func (c *DefaultApiController) GetOrders(w http.ResponseWriter, r *http.Request)
GetOrders - Your GET endpoint
func (*DefaultApiController) GetProducts ¶
func (c *DefaultApiController) GetProducts(w http.ResponseWriter, r *http.Request)
GetProducts - Your GET endpoint
func (*DefaultApiController) GetStatus ¶
func (c *DefaultApiController) GetStatus(w http.ResponseWriter, r *http.Request)
GetStatus - Your GET endpoint
func (*DefaultApiController) GetWallet ¶
func (c *DefaultApiController) GetWallet(w http.ResponseWriter, r *http.Request)
GetWallet - Your GET endpoint
func (*DefaultApiController) GetWorkflowMinterNvla ¶
func (c *DefaultApiController) GetWorkflowMinterNvla(w http.ResponseWriter, r *http.Request)
GetWorkflowMinterNvla -
func (*DefaultApiController) PostCardanoTransaction ¶
func (c *DefaultApiController) PostCardanoTransaction(w http.ResponseWriter, r *http.Request)
PostCardanoTransaction -
func (*DefaultApiController) PostOrders ¶
func (c *DefaultApiController) PostOrders(w http.ResponseWriter, r *http.Request)
PostOrders -
func (*DefaultApiController) PostProducts ¶
func (c *DefaultApiController) PostProducts(w http.ResponseWriter, r *http.Request)
PostProducts -
func (*DefaultApiController) PostWorkflowMinterNvla ¶
func (c *DefaultApiController) PostWorkflowMinterNvla(w http.ResponseWriter, r *http.Request)
PostWorkflowMinterNvla -
func (*DefaultApiController) Routes ¶
func (c *DefaultApiController) Routes() Routes
Routes returns all of the api route for the DefaultApiController
type DefaultApiRouter ¶
type DefaultApiRouter interface { GetCardanoTip(http.ResponseWriter, *http.Request) GetOrders(http.ResponseWriter, *http.Request) GetProducts(http.ResponseWriter, *http.Request) GetStatus(http.ResponseWriter, *http.Request) GetWallet(http.ResponseWriter, *http.Request) GetWorkflowMinterNvla(http.ResponseWriter, *http.Request) PostCardanoTransaction(http.ResponseWriter, *http.Request) PostOrders(http.ResponseWriter, *http.Request) PostProducts(http.ResponseWriter, *http.Request) PostWorkflowMinterNvla(http.ResponseWriter, *http.Request) }
DefaultApiRouter defines the required methods for binding the api requests to a responses for the DefaultApi The DefaultApiRouter implementation should parse necessary information from the http request, pass the data to a DefaultApiServicer to perform the required actions, then write the service results to the http response.
type DefaultApiService ¶
type DefaultApiService struct { }
DefaultApiService is a service that implents the logic for the DefaultApiServicer This service should implement the business logic for every endpoint for the DefaultApi API. Include any external packages or services that will be required by this service.
func (*DefaultApiService) GetCardanoTip ¶
func (s *DefaultApiService) GetCardanoTip(ctx context.Context) (ImplResponse, error)
GetCardanoTip - Your GET endpoint
func (*DefaultApiService) GetOrders ¶
func (s *DefaultApiService) GetOrders(ctx context.Context, orderId string) (ImplResponse, error)
GetOrders - Your GET endpoint
func (*DefaultApiService) GetProducts ¶
func (s *DefaultApiService) GetProducts(ctx context.Context, marketId string, organizationId string) (ImplResponse, error)
GetProducts - Your GET endpoint
func (*DefaultApiService) GetStatus ¶
func (s *DefaultApiService) GetStatus(ctx context.Context) (ImplResponse, error)
GetStatus - Your GET endpoint
func (*DefaultApiService) GetWallet ¶
func (s *DefaultApiService) GetWallet(ctx context.Context, walletAddress string) (ImplResponse, error)
GetWallet - Your GET endpoint
func (*DefaultApiService) GetWorkflowMinterNvla ¶
func (s *DefaultApiService) GetWorkflowMinterNvla(ctx context.Context) (ImplResponse, error)
GetWorkflowMinterNvla -
func (*DefaultApiService) PostCardanoTransaction ¶
func (s *DefaultApiService) PostCardanoTransaction(ctx context.Context, cardanoTransaction CardanoTransaction) (ImplResponse, error)
PostCardanoTransaction -
func (*DefaultApiService) PostOrders ¶
func (s *DefaultApiService) PostOrders(ctx context.Context, order Order) (ImplResponse, error)
PostOrders -
func (*DefaultApiService) PostProducts ¶
func (s *DefaultApiService) PostProducts(ctx context.Context, productsList ProductsList) (ImplResponse, error)
PostProducts -
func (*DefaultApiService) PostWorkflowMinterNvla ¶
func (s *DefaultApiService) PostWorkflowMinterNvla(ctx context.Context, minterInfo MinterInfo) (ImplResponse, error)
PostWorkflowMinterNvla -
type DefaultApiServicer ¶
type DefaultApiServicer interface { GetCardanoTip(context.Context) (ImplResponse, error) GetOrders(context.Context, string) (ImplResponse, error) GetProducts(context.Context, string, string) (ImplResponse, error) GetStatus(context.Context) (ImplResponse, error) GetWallet(context.Context, string) (ImplResponse, error) GetWorkflowMinterNvla(context.Context) (ImplResponse, error) PostCardanoTransaction(context.Context, CardanoTransaction) (ImplResponse, error) PostOrders(context.Context, Order) (ImplResponse, error) PostProducts(context.Context, ProductsList) (ImplResponse, error) PostWorkflowMinterNvla(context.Context, MinterInfo) (ImplResponse, error) }
DefaultApiServicer defines the api actions for the DefaultApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
func NewDefaultApiService ¶
func NewDefaultApiService() DefaultApiServicer
NewDefaultApiService creates a default api service
type DescriptionSet ¶
type DescriptionSet struct { // A short description makes a good header Short string `json:"short"` // A long description makes a good paragraph body. Supports Markdown. Long string `json:"long"` }
DescriptionSet - Set of descriptions
type Extended721Token ¶
type Extended721Token struct { NativeToken NativeToken `json:"native_token,omitempty"` // List of extensions for parser to understand feature set. This may be empty, in which case the token is interpreted as just a 721 token. Extension []string `json:"extension,omitempty"` // Token number in a set. Redundant field which makes no sense for tokens without a total-order. Id int32 `json:"id"` // Display name for token. Name string `json:"name"` // Image URL without source redundancy. Image string `json:"image"` }
Extended721Token - Easily parsable data for Extended 721 Token
type ImplResponse ¶
type ImplResponse struct { Code int Body interface{} }
Implementation response defines an error code with the associated body
func Response ¶
func Response(code int, body interface{}) ImplResponse
Response return a ImplResponse struct filled
type MinterInfo ¶
type MinterInfo struct { // Wallet that pays transaction fee WalletAddress string `json:"wallet_address"` // Wallet that received minted tokens MinterDepositAddress string `json:"minter_deposit_address"` }
MinterInfo - Generic information required for minter workflows.
type NativeToken ¶
type NativeToken struct { // On-chain policy-id PolicyId string `json:"policy_id"` // On-chain asset-id AssetId string `json:"asset_id"` }
NativeToken - Definitions required to reference a native token
type NovelliaProduct ¶
type NovelliaProduct struct { // Attribution of rights to product. Copyright string `json:"copyright"` // List of publishers or entities involved in token creation. Useful for onlookers to determine token origin. Publisher []string `json:"publisher"` // Iteration in update sequence for product. Version int32 `json:"version"` // Display name for token. Name string `json:"name"` // Tags for sorting and filtering. \"nsfw\" indicates NSFW content Tags []string `json:"tags"` Commission []Commission `json:"commission,omitempty"` Description DescriptionSet `json:"description"` Resource []OffChainResource `json:"resource"` // Token number in a set. Redundant field which makes no sense for tokens without a total-order. Id int32 `json:"id,omitempty"` }
NovelliaProduct - Product listed on Novelia without a token
type NovelliaStandardToken ¶
type NovelliaStandardToken struct { // Attribution of rights. Copyright string `json:"copyright"` // List of publishers or entities involved in token creation. Useful for onlookers to determine token origin. These can be URLs. Publisher []string `json:"publisher"` // Token version. May have future use such as for clients optionally using later metadata iterations. Version int32 `json:"version"` // List of extensions for parser to understand feature set. This may be empty, in which case the token is interpreted as just a 721 token. Extension []string `json:"extension"` // Token number in a set. Redundant field which makes no sense for tokens without a total-order. Id int32 `json:"id"` // Display name for token. Name string `json:"name"` // Image URL without source redundancy. Image string `json:"image"` Description DescriptionSet `json:"description"` Resource []OffChainResource `json:"resource"` Commission []Commission `json:"commission,omitempty"` NativeToken NativeToken `json:"native_token"` // Identifies the version of the specification in use. NovelliaVersion int32 `json:"novellia_version"` // Tags for sorting and filtering. \"nsfw\" indicates NSFW content Tags []string `json:"tags"` }
NovelliaStandardToken - Novellia Token Standard on-chain metadata
type OccultaNovelliaCharacter ¶
type OccultaNovelliaCharacter struct { // Specification version for parsing the resource OccultaNovelliaVersion int32 `json:"occulta_novellia_version"` // Character name Name string `json:"name"` Card OccultaNovelliaCharacterCard `json:"card"` Progression OccultaNovelliaCharacterProgression `json:"progression"` Stats OccultaNovelliaCharacterStats `json:"stats"` // List of attribute strings relating to character abilities, faction, types, etc. Attributes []string `json:"attributes"` // Description of character Description string `json:"description"` }
OccultaNovelliaCharacter - Model for an Occulta Novellia character
type OccultaNovelliaCharacterCard ¶
type OccultaNovelliaCharacterCard struct { // The character number Number int32 `json:"number"` // The set this character was released in ReleaseSet string `json:"release_set"` // Rarity of card (\"Rare\", \"Kinda Not\", \"Not That Rare\") Rarity string `json:"rarity"` }
OccultaNovelliaCharacterCard - Metadata relating to card / distribution
type OccultaNovelliaCharacterProgression ¶
type OccultaNovelliaCharacterProgression struct { // Character progression class Class string `json:"class"` // Stage of character in class progression (1,2,3) Stage int32 `json:"stage"` }
OccultaNovelliaCharacterProgression - Character leveling progression between card variants
type OccultaNovelliaCharacterStats ¶
type OccultaNovelliaCharacterStats struct { // Damage sustained before dying Health int32 `json:"health"` // Multiplier for damage dealt as defined by attribute moves Attack int32 `json:"attack"` // Action points cost per unit of movement Move int32 `json:"move"` // Slots used by character when added to a squad Slots int32 `json:"slots"` }
OccultaNovelliaCharacterStats - Integer stats
type OffChainResource ¶
type OffChainResource struct { // Resource identifier interpreted by application. These may correspond to specific names resources a client expects. ResourceId string `json:"resource_id"` // Short text describing resource. Helpful to know what the resource should have been if the resource breaks. Description string `json:"description"` // Order to load resource. Lower numbers load first. Resources with the same name will progressively overwrite each other. Priority int32 `json:"priority"` // The multihash of the resource. In most cases, this may be identical to an IPFS hash. Multihash string `json:"multihash"` // Hint regarding file state prior to hashing (ipfs, direct) HashSourceType string `json:"hash_source_type"` // Redundant resource URLs. These should all point to the same file on different hosts. Url []string `json:"url"` // MIME type of resource. ContentType string `json:"content_type"` }
OffChainResource - Off-chain resource used in Novellia Token Standard
type Order ¶
type Order struct { Items []OrderItems `json:"items"` Customer OrderCustomer `json:"customer"` Payment OrderPayment `json:"payment,omitempty"` // Order ID for future reference OrderId string `json:"order_id"` // Description of order, useful metadata such as presale that occurred, etc. Description string `json:"description"` // Order status (i.e. awaiting payment, queued, refunded, ...) OrderStatus string `json:"order_status"` }
Order - Describes a single order
type OrderCreated ¶
type OrderCreated struct {
OrderId string `json:"order_id"`
}
OrderCreated - Response after an order is made
type OrderCustomer ¶
type OrderCustomer struct { // Address to deliver tokens to DeliveryAddress string `json:"delivery_address"` }
type OrderItems ¶
type OrderPayment ¶
type OrderPayment struct { // Address to deposit currency PaymentAddress string `json:"payment_address"` // Policy ID of currency PriceCurrencyId string `json:"price_currency_id"` // Amount due in currency. Use `number` for fiat, but ADA is lovelace integral PriceAmount float32 `json:"price_amount"` // Payment status (i.e. waiting, received, ...) PaymentStatus string `json:"payment_status"` }
type Product ¶
type Product struct { Pricing ProductPricing `json:"pricing"` Organization ProductOrganization `json:"organization"` Market ProductMarket `json:"market"` Stock ProductStock `json:"stock"` Metadata ProductMetadata `json:"metadata"` Product ProductProduct `json:"product"` // List of entities to give attribution to for product Attribution []Attribution `json:"attribution,omitempty"` }
Product - Describes a Product served from the Novellia microservice
type ProductMarket ¶
type ProductMetadata ¶
type ProductOrganization ¶
type ProductPricing ¶
type ProductProduct ¶
type ProductProduct struct { Extended721Token *Extended721Token `json:"extended_721_token,omitempty"` NovelliaStandardToken *NovelliaStandardToken `json:"novellia_standard_token,omitempty"` NativeToken *NativeToken `json:"native_token,omitempty"` NovelliaProduct *NovelliaProduct `json:"novellia_product,omitempty"` // Unique identifier of product ProductId string `json:"product_id"` }
ProductProduct - Immutable
type ProductStock ¶
type ProductsList ¶
type ProductsList struct { // List of available products ProductId []string `json:"product_id"` }
ProductsList - Light-weight list of products for further querying
type Route ¶
type Route struct { Name string Method string Pattern string HandlerFunc http.HandlerFunc }
A Route defines the parameters for an api endpoint
type Router ¶
type Router interface {
Routes() Routes
}
Router defines the required methods for retrieving api routes
func NewDefaultApiController ¶
func NewDefaultApiController(s DefaultApiServicer) Router
NewDefaultApiController creates a default api controller
type Status ¶
type Status struct { Cardano StatusCardano `json:"cardano"` // kill-switch to tell users that the backend is not working correctly / is under maintenance Maintenance bool `json:"maintenance"` }
Status - Status of Novellia microservice, indicating service availabilities
type StatusCardano ¶
type Token ¶
type Token struct { // Token asset ID registered on Cardano AssetId string `json:"asset_id"` // Amount of token held in Cardano wallet (in discrete units, i.e. lovelace) Amount int32 `json:"amount"` // Name or ticker as interpreted by Novellia (e.g. NVLA, ADA) Name string `json:"name,omitempty"` // Short description of token as interpreted by Novellia Description string `json:"description,omitempty"` }
Token - Generalizes the data required to describe a token in a Cardano wallet.
type WorkflowInformation ¶
type WorkflowInformation struct { // The lovelace cost to execute the workflow FeeLovelace int32 `json:"fee_lovelace,omitempty"` }
WorkflowInformation - Returns preconditions relevant to a user wanting to execute a workflow. I.e. costs.
Source Files ¶
- api.go
- api_default.go
- api_default_service.go
- helpers.go
- impl.go
- logger.go
- model_attribution.go
- model_cardano_tip.go
- model_cardano_transaction.go
- model_commission.go
- model_description_set.go
- model_extended721_token.go
- model_minter_info.go
- model_native_token.go
- model_novellia_product.go
- model_novellia_standard_token.go
- model_occulta_novellia_character.go
- model_occulta_novellia_character_card.go
- model_occulta_novellia_character_progression.go
- model_occulta_novellia_character_stats.go
- model_off_chain_resource.go
- model_order.go
- model_order_created.go
- model_order_customer.go
- model_order_items.go
- model_order_payment.go
- model_product.go
- model_product_market.go
- model_product_metadata.go
- model_product_organization.go
- model_product_pricing.go
- model_product_product.go
- model_product_stock.go
- model_products_list.go
- model_status.go
- model_status_cardano.go
- model_token.go
- model_workflow_information.go
- routers.go