rest

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package rest implements the rest driver

Index

Constants

View Source
const (
	QUOTE_ROUTE = "/quote"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServer

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

APIServer is the server object. TODO: this should be an interface.

func NewRestAPIServer

func NewRestAPIServer(ctx context.Context, cfg *config.Config) (*APIServer, error)

NewRestAPIServer creates a new instance of the rest api server.

func (*APIServer) Authenticate

func (r *APIServer) Authenticate(c *gin.Context, q *models.Quote) (err error)

Authenticate checks request header for EIP191 signature for a valid relayer. TODO: this should be moved to a middleware package.

func (*APIServer) Run

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

Run runs the rest api server.

func (*APIServer) Setup

func (r *APIServer) Setup()

Setup initializes rest api server routes. TODO: move this to constructor, I have no idea why this is a separate method called by the user

Directories

Path Synopsis
Package auth contains the api authentication mechanism.
Package auth contains the api authentication mechanism.

Jump to

Keyboard shortcuts

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