Documentation ¶
Index ¶
- Constants
- Variables
- func Authenticate(server *Server, c echo.Context, wallet string, sigHex string) (db.GetUserByWalletAddressRow, error)
- func GetNonce() (string, error)
- func HealthCheck(c echo.Context) error
- type AdminResponse
- type CheckBlocklistsPayload
- type CheckPayload
- type CheckUriPayload
- type DisprovePayload
- type EthUsdPrice
- type GasInfo
- type GasPrices
- type GetListPayload
- type IffIdPayload
- type LoginRequest
- type NFTMetadataRequest
- type RegisterPayload
- type Response
- type Result
- type Server
- func (server *Server) AdminLogin(e echo.Context) error
- func (server *Server) AuthMiddleware(next echo.HandlerFunc) echo.HandlerFunc
- func (server *Server) CheckBlocklists(c echo.Context) (err error)
- func (server *Server) CheckExistBlocklists(c echo.Context) (err error)
- func (server *Server) CheckSpamContract(c echo.Context) (err error)
- func (server *Server) DeleteUser(e echo.Context) error
- func (server *Server) DisproveBlocklist(c echo.Context) (err error)
- func (server *Server) EthToUsd(c echo.Context) (err error)
- func (server *Server) FetchIffNftById(c echo.Context) (err error)
- func (server *Server) FetchIffNftMeta(c echo.Context) (err error)
- func (server *Server) FetchUserIffNfts(c echo.Context) (err error)
- func (server *Server) FetchUserNfts(c echo.Context) (err error)
- func (server *Server) GasHandler(c echo.Context) (err error)
- func (server *Server) GetAllBlockLists(c echo.Context) (err error)
- func (server *Server) GetAllUsers(e echo.Context) error
- func (server *Server) GetBlockListById(c echo.Context) (err error)
- func (server *Server) GetBlocklistByUri(c echo.Context) (err error)
- func (server *Server) ListDisprovedBlocklists(c echo.Context) (err error)
- func (server *Server) ListNftProjects(c echo.Context) error
- func (server *Server) ListUnreviewedBlocklists(c echo.Context) (err error)
- func (server *Server) ListVerifiedBlocklists(c echo.Context) (err error)
- func (server *Server) LoginHandler(c echo.Context) (err error)
- func (server *Server) NewUser(e echo.Context) error
- func (server *Server) NonceHandler(c echo.Context) (err error)
- func (server *Server) RunCronFetchGas()
- func (server *Server) Start(address string) error
- func (server *Server) UnlockChannel(e echo.Context) error
- func (server *Server) VerifyBlocklist(c echo.Context) (err error)
- type SigninPayload
- type Token
- type User
- type VerifyPayload
Constants ¶
const (
AuthorizationPayloadKey = "authorization_payload"
)
Variables ¶
var ( ErrUserNotExists = errors.New("user does not exist") ErrUserExists = errors.New("user already exists") ErrInvalidAddress = errors.New("invalid address") ErrInvalidNonce = errors.New("invalid nonce") ErrMissingSig = errors.New("signature is missing") ErrAuthError = errors.New("authentication error") )
Functions ¶
func Authenticate ¶
func HealthCheck ¶
func HealthCheck(c echo.Context) error
HealthCheck godoc @Summary Show the status of server. @Description get the status of server. @Tags health @Accept */* @Produce json @Success 200 {object} map[string]interface{} @Router /health [get]
Types ¶
type AdminResponse ¶
type AdminResponse struct { Message string `json:"message"` Data interface{} `json:"data"` Error interface{} `json:"error"` }
type CheckBlocklistsPayload ¶
type CheckBlocklistsPayload struct {
UUID string `json:"uuid"`
}
type CheckPayload ¶
type CheckPayload struct {
Address string `json:"address"`
}
func (CheckPayload) Validate ¶
func (ch CheckPayload) Validate() error
type CheckUriPayload ¶
type CheckUriPayload struct {
Uri string `json:"uri"`
}
type DisprovePayload ¶
type DisprovePayload struct {
UUID string `json:"uuid"`
}
type EthUsdPrice ¶
type EthUsdPrice struct {
Usd float64 `json:"USD"`
}
type GetListPayload ¶
type GetListPayload struct {
UUID string `json:"uuid"`
}
type IffIdPayload ¶
type IffIdPayload struct {
IffId string `json:"iffid"`
}
type LoginRequest ¶
type NFTMetadataRequest ¶
type RegisterPayload ¶
type RegisterPayload struct {
Wallet string `json:"wallet"`
}
func (RegisterPayload) Validate ¶
func (p RegisterPayload) Validate() error
type Server ¶
type Server struct { Echo *echo.Echo // contains filtered or unexported fields }
Server serves HTTP requests for our nft-platform service.
func (*Server) AdminLogin ¶
func (*Server) AuthMiddleware ¶
func (server *Server) AuthMiddleware(next echo.HandlerFunc) echo.HandlerFunc
AuthMiddleware creates an echo middleware for authorization
func (*Server) CheckBlocklists ¶
blocklists godoc @Summary CheckBlocklists @Description fetch blocklist by uri @Tags CheckBlocklists @param uuid body string true "uuid" @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /checkBlocklists [POST]
func (*Server) CheckExistBlocklists ¶
blocklists godoc @Summary CheckExistBlocklists @Description fetch blocklist by uri @Tags CheckExistBlocklists @param uri body string true "uri" @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /checkExistBlocklists [POST]
func (*Server) CheckSpamContract ¶
nft godoc @Summary checkSpamContract @Description fetch limited IffNft @Tags checkSpamContract @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /checkSpamContract [POST]
func (*Server) DeleteUser ¶
func (*Server) DisproveBlocklist ¶
blocklists godoc @Summary DisproveBlocklist @Description disprove blocklist by uuid @Tags DisproveBlocklist @param uuid body string true "uuid" @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /api/disproveBlocklist [POST]
func (*Server) EthToUsd ¶
ethToUsd godoc @Summary ethToUsd @Description get current 1 ETH to USD price @Tags ethToUsd @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /ethToUsd [GET]
func (*Server) FetchIffNftById ¶
nft godoc @Summary fetchIffNftById @Description fetch limited IffNft @Tags getIffNftById @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /fetchIffNftById [POST]
func (*Server) FetchIffNftMeta ¶
nft godoc @Summary getIffNftMeta @Description fetch limited IffNft @Tags getIffNftMeta @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /getIffNftMeta [GET]
func (*Server) FetchUserIffNfts ¶
nft godoc @Summary fetchUserIffNfts @Description get USER IffNFTS @Tags fetchUserIffNfts @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /auth/fetchUserIffNfts [POST]
func (*Server) FetchUserNfts ¶
mintit godoc @Summary fetchUserNfts @Description get mintable USER NFTS @Tags fetchUserNfts @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /auth/fetchUserNfts [POST]
func (*Server) GasHandler ¶
gasInfo godoc @Summary gasInfo @Description get every minutes gas prices @Tags gasInfo @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /gasInfo [GET]
func (*Server) GetAllBlockLists ¶
blocklists godoc @Summary getAllBlockLists @Description get all blocklists @Tags getAllBlockLists @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /api/getAllBlockLists [GET]
func (*Server) GetAllUsers ¶
func (*Server) GetBlockListById ¶
blocklists godoc @Summary fetchBlockListById @Description fetch blocklist by uuid @Tags fetchBlockListById @param uuid body string true "uuid" @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /api/fetchBlockListById [POST]
func (*Server) GetBlocklistByUri ¶
blocklists godoc @Summary checkUri @Description fetch blocklist by uri @Tags checkUri @param uri body string true "uri" @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /checkUri [POST]
func (*Server) ListDisprovedBlocklists ¶
blocklists godoc @Summary ListDisprovedBlocklists @Description get all disproved blocklists @Tags ListDisprovedBlocklists @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /api/listDisprovedBlocklists [GET]
func (*Server) ListNftProjects ¶
nft godoc @Summary nftProjects @Description fetch limited nft projects @Tags nftProjects @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /nftProjects [GET]
func (*Server) ListUnreviewedBlocklists ¶
blocklists godoc @Summary ListUnreviewedBlocklists @Description get all unreviewed blocklists @Tags ListUnreviewedBlocklists @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /api/listUnreviewedBlocklists [GET]
func (*Server) ListVerifiedBlocklists ¶
blocklists godoc @Summary ListVerifiedBlocklists @Description fetch verified blocklists @Tags ListVerifiedBlocklists @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /api/listVerifiedBlocklists [GET]
func (*Server) LoginHandler ¶
login godoc @Summary login @Description login @Tags login @Accept json @produce application/json @param wallet body string true "wallet" @param signature body string true "signature" @Success 200 {string} StatusOK @Success 201 {string} StatusOK @Failure 400 {string} StatusBadRequest @Failure 404 {string} StatusNotFound @Failure 500 {string} StatusInternalServerError @Router /login [POST]
func (*Server) NonceHandler ¶
code godoc @Summary code @Description register a new user @Tags code @Accept json @produce application/json @param wallet body string true "wallet" @Success 200 {string} StatusOK @Success 201 {string} StatusOK @Failure 400 {string} StatusBadRequest @Failure 404 {string} StatusNotFound @Failure 500 {string} StatusInternalServerError @Router /code [POST]
func (*Server) RunCronFetchGas ¶
func (server *Server) RunCronFetchGas()
func (*Server) UnlockChannel ¶
blocklists godoc @Summary Unlock discord channel @Description unlock discord channel to allow report project @Tags Admin Page @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /discord/channel/unlock/:id [PATCH]
func (*Server) VerifyBlocklist ¶
blocklists godoc @Summary VerifyBlocklist @Description verify blocklist by uuid @Tags VerifyBlocklist @param uuid body string true "uuid" @Accept */* @produce application/json @Success 200 {string} StatusOK @Router /api/verifyBlocklist [POST]
type SigninPayload ¶
func (SigninPayload) Validate ¶
func (s SigninPayload) Validate() error
type VerifyPayload ¶
type VerifyPayload struct {
UUID string `json:"uuid"`
}