server

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidTopCexInRequest       = errors.New("invalid cex in request")
	ErrInvalidTopCexOutRequest      = errors.New("invalid cex out request")
	ErrInvalidTopNetInRequest       = errors.New("invalid net in request")
	ErrInvalidTopNetOutRequest      = errors.New("invalid net out request")
	ErrInvalidTopUserProfitRequest  = errors.New("invalid user profit request")
	ErrInvalidTopTokenProfitRequest = errors.New("invalid token profit request")
	ErrInvalidTokenInspect          = errors.New("invalid token inspect")
	ErrInvalidUserInspect           = errors.New("invalid user inspect")
	ErrInvalidDuration              = errors.New("invalid duration")

	ErrInvalidListToken     = errors.New("invalid get list token")
	ErrInvalidListUser      = errors.New("invalid get list user")
	ErrInvalidGetActivities = errors.New("invalid get activities")
)

Functions

This section is empty.

Types

type Address

type Address struct {
	Addr         string  `json:"address"`
	Value        float64 `json:"value"`
	Symbol       string  `json:"symbol,omitempty"`
	Network      string  `json:"network,omitempty"`
	CurrentPrice float64 `json:"current_price,omitempty"` // user for token only
	ImageUrl     string  `json:"image_url,omitempty"`     // user for token only
}

type GetActivitiesRequest added in v0.0.4

type GetActivitiesRequest struct {
	Action string `form:"action" binding:"required"`
	Chain  string `form:"chain" binding:"required"`
}

type GetTokenProfitRequest

type GetTokenProfitRequest struct {
	LimitTokenAddressProfit int           `form:"limitTokenAddress" binding:"required,numeric,min=0"`
	Duration                time.Duration `form:"duration" binding:"required"`
}

type GetTokenProfitRes added in v0.0.2

type GetTokenProfitRes struct {
	Address
	Gains   float64 `json:"gains"`
	AvgCost float64 `json:"avg_cost"`
	NetFlow float64 `json:"net_flow"`
}

type GetUserProfitRequest

type GetUserProfitRequest struct {
	LimitTopAddressProfit int           `form:"limitTopAddress" binding:"required,numeric,min=0"`
	Duration              time.Duration `form:"duration" binding:"required"`
}

type ListTokenRequest

type ListTokenRequest struct {
	Chain string `form:"chain" binding:"required"`
}

type ListUserRequest

type ListUserRequest struct {
	Chain string `form:"chain" binding:"required"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server to serve the service.

func NewServer

func NewServer(bindAddr string, storage *storage.Storage) *Server

New returns a new server.

func (*Server) Run

func (s *Server) Run() error

Run runs server.

type TokenInspect

type TokenInspect struct {
	Address               string        `form:"address" binding:"required"`
	LimitTopAddressProfit int           `form:"limitTopAddress" binding:"required,numeric,min=0"`
	Duration              time.Duration `form:"duration" binding:"required"`
}

type TopCexInRequest

type TopCexInRequest struct {
	LimitTopNetCexIn int           `form:"limitTopNetCexIn" binding:"required,numeric,min=0"`
	Duration         time.Duration `form:"duration" binding:"required"`
}

type TopCexOutRequest

type TopCexOutRequest struct {
	LimitTopNetCexOut int           `form:"limitTopNetCexOut" binding:"required,numeric,min=0"`
	Duration          time.Duration `form:"duration" binding:"required"`
}

type UserInspect

type UserInspect struct {
	Address  string        `form:"address" binding:"required"`
	Duration time.Duration `form:"duration" binding:"required"`
}

Jump to

Keyboard shortcuts

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