Documentation ¶
Index ¶
- type Server
- func (s *Server) FindAsset(ctx context.Context, req *api.Req_FindAsset) (*api.Asset, error)
- func (s *Server) FindCollateral(ctx context.Context, req *api.Req_FindCollateral) (*api.Collateral, error)
- func (s *Server) FindFlip(ctx context.Context, req *api.Req_FindFlip) (*api.Flip, error)
- func (s *Server) FindOracle(ctx context.Context, req *api.Req_FindOracle) (*api.Oracle, error)
- func (s *Server) FindProposal(ctx context.Context, req *api.Req_FindProposal) (*api.Proposal, error)
- func (s *Server) FindTransaction(ctx context.Context, req *api.Req_FindTransaction) (*api.Transaction, error)
- func (s *Server) FindVault(ctx context.Context, req *api.Req_FindVault) (*api.Vault, error)
- func (s *Server) Handle(sessions core.Session) http.Handler
- func (s *Server) ListAggregatedStats(ctx context.Context, req *api.Req_ListAggregatedStats) (*api.Resp_ListAggregatedStats, error)
- func (s *Server) ListAssets(ctx context.Context, _ *api.Req_ListAssets) (*api.Resp_ListAssets, error)
- func (s *Server) ListCollaterals(ctx context.Context, _ *api.Req_ListCollaterals) (*api.Resp_ListCollaterals, error)
- func (s *Server) ListFlipEvents(ctx context.Context, req *api.Req_ListFlipEvents) (*api.Resp_ListFlipEvents, error)
- func (s *Server) ListFlips(ctx context.Context, req *api.Req_ListFlips) (*api.Resp_ListFlips, error)
- func (s *Server) ListMyVaults(ctx context.Context, req *api.Req_ListMyVaults) (*api.Resp_ListMyVaults, error)
- func (s *Server) ListOracles(ctx context.Context, _ *api.Req_ListOracles) (*api.Resp_ListOracles, error)
- func (s *Server) ListProposals(ctx context.Context, req *api.Req_ListProposals) (*api.Resp_ListProposals, error)
- func (s *Server) ListStats(ctx context.Context, req *api.Req_ListStats) (*api.Resp_ListStats, error)
- func (s *Server) ListTransactions(ctx context.Context, req *api.Req_ListTransactions) (*api.Resp_ListTransactions, error)
- func (s *Server) ListVaultEvents(ctx context.Context, req *api.Req_ListVaultEvents) (*api.Resp_ListVaultEvents, error)
- func (s *Server) ListVaults(ctx context.Context, req *api.Req_ListVaults) (*api.Resp_ListVaults, error)
- func (s *Server) QueryFlips(ctx context.Context, req *api.Req_QueryFlips) (*api.Resp_QueryFlips, error)
- func (s *Server) TwirpServer() api.TwirpServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func New ¶
func New( assets core.AssetStore, vaults core.VaultStore, flips core.FlipStore, oracles core.OracleStore, collaterals core.CollateralStore, transactions core.TransactionStore, proposalz core.ProposalService, proposals core.ProposalStore, stats core.StatStore, ) *Server
func (*Server) FindAsset ¶
FindAsset godoc @Summary Find Asset By ID @Description @Tags Assets @Accept json @Produce json @param asset_id path string true "mixin asset id" @Success 200 {object} api.Asset @Router /assets/{asset_id} [get]
func (*Server) FindCollateral ¶
func (s *Server) FindCollateral(ctx context.Context, req *api.Req_FindCollateral) (*api.Collateral, error)
FindCollateral godoc @Summary find collateral by id @Description @Tags Collaterals @Accept json @Produce json @param id path string true "collateral id" @Success 200 {object} api.Collateral @Router /cats/{id} [get]
func (*Server) FindFlip ¶
FindFlip godoc @Summary find flip by id @Description @Tags Flips @Accept json @Produce json @param id path string true "flip id" @Success 200 {object} api.Flip @Router /flips/{id} [get]
func (*Server) FindOracle ¶
FindOracle godoc @Summary find oracle by asset id @Description @Tags Oracles @Accept json @Produce json @param asset_id path string true "mixin asset id" @Success 200 {object} api.Oracle @Router /oracles/{asset_id} [get]
func (*Server) FindProposal ¶ added in v1.8.7
func (s *Server) FindProposal(ctx context.Context, req *api.Req_FindProposal) (*api.Proposal, error)
FindProposal godoc @Summary find proposal by id @Description @Tags Proposals @Accept json @Produce json @param id path string true "proposal id" @Success 200 {object} api.Proposal @Router /proposals/{id} [get]
func (*Server) FindTransaction ¶
func (s *Server) FindTransaction(ctx context.Context, req *api.Req_FindTransaction) (*api.Transaction, error)
FindTransaction godoc @Summary find tx by follow id @Description @Tags Transactions @Accept json @Produce json @param Authorization header string true "Example: Bearer foo" @param follow_id path string true "follow id" @Success 200 {object} api.Transaction @Router /transactions/{follow_id} [get]
func (*Server) FindVault ¶
FindVault godoc @Summary find vault by id @Description @Tags Vaults @Accept json @Produce json @param id path string true "vault id" @Success 200 {object} api.Vault @Router /vats/{id} [get]
func (*Server) ListAggregatedStats ¶ added in v1.9.1
func (s *Server) ListAggregatedStats(ctx context.Context, req *api.Req_ListAggregatedStats) (*api.Resp_ListAggregatedStats, error)
ListAggregatedStats godoc @Summary list aggregated stats @Description @Tags Stats @Accept json @Produce json @param request query api.Req_ListAggregatedStats false "default limit 50" @Success 200 {object} api.Resp_ListAggregatedStats @Router /stats [get]
func (*Server) ListAssets ¶
func (s *Server) ListAssets(ctx context.Context, _ *api.Req_ListAssets) (*api.Resp_ListAssets, error)
ListAssets godoc @Summary list assets @Description @Tags Assets @Accept json @Produce json @Success 200 {object} api.Resp_ListAssets @Router /assets [get]
func (*Server) ListCollaterals ¶
func (s *Server) ListCollaterals(ctx context.Context, _ *api.Req_ListCollaterals) (*api.Resp_ListCollaterals, error)
ListCollaterals godoc @Summary list all collateral @Description @Tags Collaterals @Accept json @Produce json @Success 200 {object} api.Resp_ListCollaterals @Router /cats [get]
func (*Server) ListFlipEvents ¶
func (s *Server) ListFlipEvents(ctx context.Context, req *api.Req_ListFlipEvents) (*api.Resp_ListFlipEvents, error)
ListFlipEvents godoc @Summary list flip events @Description @Tags Flips @Accept json @Produce json @param id path string true "flip id" @Success 200 {object} api.Resp_ListFlipEvents @Router /flips/{id}/events [get]
func (*Server) ListFlips ¶
func (s *Server) ListFlips(ctx context.Context, req *api.Req_ListFlips) (*api.Resp_ListFlips, error)
ListFlips godoc @Summary list flips @Description @Tags Flips @Accept json @Produce json @param request query api.Req_ListFlips false "default limit 50" @Success 200 {object} api.Resp_ListFlips @Router /flips [get]
func (*Server) ListMyVaults ¶
func (s *Server) ListMyVaults(ctx context.Context, req *api.Req_ListMyVaults) (*api.Resp_ListMyVaults, error)
ListMyVaults godoc @Summary list my vaults @Description @Tags Vaults @Accept json @Produce json @param request query api.Req_ListMyVaults false "default limit 50" @param Authorization header string true "Example: Bearer foo" @Success 200 {object} api.Resp_ListVaults @Router /me/vats [get]
func (*Server) ListOracles ¶
func (s *Server) ListOracles(ctx context.Context, _ *api.Req_ListOracles) (*api.Resp_ListOracles, error)
ListOracles godoc @Summary list all oracles @Description @Tags Oracles @Accept json @Produce json @Success 200 {object} api.Resp_ListOracles @Router /oracles [get]
func (*Server) ListProposals ¶ added in v1.8.7
func (s *Server) ListProposals(ctx context.Context, req *api.Req_ListProposals) (*api.Resp_ListProposals, error)
ListProposals godoc @Summary list proposals @Description @Tags Proposals @Accept json @Produce json @param request query api.Req_ListProposals false "default limit 50" @Success 200 {object} api.Resp_ListProposals @Router /proposals [get]
func (*Server) ListStats ¶ added in v1.9.1
func (s *Server) ListStats(ctx context.Context, req *api.Req_ListStats) (*api.Resp_ListStats, error)
ListStats godoc @Summary list stats @Description @Tags Stats @Accept json @Produce json @param id path string true "collateral id" @Success 200 {object} api.Resp_ListStats false @Router /stats/{id} [get]
func (*Server) ListTransactions ¶
func (s *Server) ListTransactions(ctx context.Context, req *api.Req_ListTransactions) (*api.Resp_ListTransactions, error)
ListTransactions godoc @Summary list transactions @Description @Tags Transactions @Accept json @Produce json @param request query api.Req_ListTransactions false "default limit 50" @Success 200 {object} api.Resp_ListTransactions @Router /transactions [get]
func (*Server) ListVaultEvents ¶
func (s *Server) ListVaultEvents(ctx context.Context, req *api.Req_ListVaultEvents) (*api.Resp_ListVaultEvents, error)
ListVaultEvents godoc @Summary list vault events @Description @Tags Vaults @Accept json @Produce json @param id path string true "vault id" @param request query api.Req_ListVaultEvents false "default limit 50" @Success 200 {object} api.Resp_ListVaultEvents @Router /vats/{id}/events [get]
func (*Server) ListVaults ¶
func (s *Server) ListVaults(ctx context.Context, req *api.Req_ListVaults) (*api.Resp_ListVaults, error)
ListVaults godoc @Summary list vaults @Description @Tags Vaults @Accept json @Produce json @param request query api.Req_ListVaults false "default limit 50" @Success 200 {object} api.Resp_ListVaults @Router /vats [get]
func (*Server) QueryFlips ¶ added in v1.8.9
func (s *Server) QueryFlips(ctx context.Context, req *api.Req_QueryFlips) (*api.Resp_QueryFlips, error)
QueryFlips godoc @Summary query flips @Description @Tags Flips @Accept json @Produce json @param request query api.Req_QueryFlips false "default limit 50" @Success 200 {object} api.Resp_QueryFlips @Router /query-flips [get]
func (*Server) TwirpServer ¶
func (s *Server) TwirpServer() api.TwirpServer