api

package
v0.0.0-...-5d55e2f Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeZone = "America/New_York"

Variables

This section is empty.

Functions

func BindAll

func BindAll(r *mux.Router, db *mongo.Database)

func Create

func Create[T app.Resource](
	w http.ResponseWriter,
	r *http.Request,
	s app.Store[T],
)

func Delete

func Delete[T app.Resource](
	w http.ResponseWriter,
	r *http.Request,
	s app.Store[T],
)

func Get

func Get[T app.Resource](
	w http.ResponseWriter,
	r *http.Request,
	s app.Store[T],
)

func GetAll

func GetAll[T app.Resource](
	w http.ResponseWriter,
	r *http.Request,
	s app.Store[T],
)

func NewGetAllBlockInfo

func NewGetAllBlockInfo() http.Handler

func NewGetBars

func NewGetBars(db *mongo.Database) http.Handler

func NewGetBlockInfo

func NewGetBlockInfo() http.Handler

func NewStatus

func NewStatus() http.Handler

func Update

func Update[T app.Resource](
	w http.ResponseWriter,
	r *http.Request,
	s app.Store[T],
)

Types

type CRUDAPI

type CRUDAPI[T app.Resource] struct {
	Store app.Store[T]
}

func NewCRUDAPI

func NewCRUDAPI[T app.Resource](s app.Store[T]) *CRUDAPI[T]

func (*CRUDAPI[T]) Bind

func (a *CRUDAPI[T]) Bind(r *mux.Router)

func (*CRUDAPI[T]) Create

func (a *CRUDAPI[T]) Create(w http.ResponseWriter, r *http.Request)

func (*CRUDAPI[T]) Delete

func (a *CRUDAPI[T]) Delete(w http.ResponseWriter, r *http.Request)

func (*CRUDAPI[T]) Get

func (a *CRUDAPI[T]) Get(w http.ResponseWriter, r *http.Request)

func (*CRUDAPI[T]) GetAll

func (a *CRUDAPI[T]) GetAll(w http.ResponseWriter, r *http.Request)

func (*CRUDAPI[T]) PluralRoute

func (a *CRUDAPI[T]) PluralRoute() string

func (*CRUDAPI[T]) SingularRoute

func (a *CRUDAPI[T]) SingularRoute() string

func (*CRUDAPI[T]) Update

func (a *CRUDAPI[T]) Update(w http.ResponseWriter, r *http.Request)

type ErrorResponse

type ErrorResponse struct {
	Title   string   `json:"title"`
	Message string   `json:"message"`
	Details []string `json:"details,omitempty"`
}

type Graphs

type Graphs struct {
	*CRUDAPI[*graph.Configuration]
	DB *mongo.Database
}

func NewGraphs

func NewGraphs(db *mongo.Database) *Graphs

func (*Graphs) BacktestGraph

func (a *Graphs) BacktestGraph(w http.ResponseWriter, r *http.Request)

func (*Graphs) Bind

func (a *Graphs) Bind(r *mux.Router)

func (*Graphs) EvalGraph

func (a *Graphs) EvalGraph(w http.ResponseWriter, r *http.Request)

func (*Graphs) EvalSlope

func (a *Graphs) EvalSlope(
	ctx context.Context,
	w http.ResponseWriter,
	cfg *graph.Configuration,
	requestData []byte,
)

func (*Graphs) RunDay

func (a *Graphs) RunDay(
	ctx context.Context,
	w http.ResponseWriter,
	cfg *graph.Configuration,
	requestData []byte,
)

func (*Graphs) RunGraph

func (a *Graphs) RunGraph(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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