api

package
v0.0.0-...-de2183f Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 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 NewSecurities

func NewSecurities(db *mongo.Database) (*CRUDAPI[*models.Security], error)

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 {
	ErrType string   `json:"errType"`
	Message string   `json:"message"`
	Details []string `json:"details,omitempty"`
}

type Graphs

type Graphs struct {
	*CRUDAPI[*graph.Configuration]
	// contains filtered or unexported fields
}

func NewGraphs

func NewGraphs(
	db *mongo.Database,
	securities *CRUDAPI[*models.Security],
) (*Graphs, error)

func (*Graphs) Bind

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

func (*Graphs) RunDay

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

Jump to

Keyboard shortcuts

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