stipapi

package
v0.22.9 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package stipapi provides RESTful API services for the STIP relayer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFeesAndRebatesToJSON

func ConvertFeesAndRebatesToJSON(feesAndRebates stipconfig.FeesAndRebates) map[int]interface{}

ConvertFeesAndRebatesToJSON converts the configured fees and rebates to a JSON that is more consumable.

Types

type Handler

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

Handler is the REST API handler.

func NewHandler

func NewHandler(cfg stipconfig.Config) *Handler

NewHandler creates a new REST API handler.

func (*Handler) GetFeeAndRebateInfo

func (h *Handler) GetFeeAndRebateInfo(c *gin.Context)

GetFeeAndRebateInfo returns the current STIP Relayer's rebate configuration.

func (*Handler) GetHealth

func (h *Handler) GetHealth(c *gin.Context)

GetHealth returns a successful response to signify the API is up and running.

type Server

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

Server struct holds the configuration, gin engine, and metrics handler.

func NewStipAPI

func NewStipAPI(
	ctx context.Context,
	cfg stipconfig.Config,
	handler metrics.Handler,
) (*Server, error)

NewStipAPI creates a new instance of Server with the provided configuration and metrics handler.

func (*Server) Run

func (r *Server) Run(ctx context.Context) error

Run runs the rest api server.

Jump to

Keyboard shortcuts

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