generated

package
v0.0.0-...-0f94b86 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UrlGetRowsFromSomething                         = "/some-report/rows"
	UrlGetRowsFromSomethingContextOnly              = "/some-report-context-only/rows"
	UrlGetRowsFromSomethingContextOnlyWithSuccessCb = "/some-report-context-only-with-success-cb/rows"
	UrlGetRowsFromSomethingNoSuccessCb              = "/some-report-no-success-cb/rows"
)

Variables

This section is empty.

Functions

func XlsxCb

func XlsxCb(c *gin.Context, rows []Row)

Types

type ItoGenerate

type ItoGenerate interface {

	// GetRowsFromSomething documentation
	// @Param authorization header string false "Authorization: Bearer"
	// @Tags the_tag
	// @Param X-Request-Id header string false "Request-Id"
	// @Router /some-report/rows [GET]
	// @Gorg param dt tags binding:"required"
	// @Gorg param dt comment Datetime (RFC3339|RFC3339Nano), ex. 2021-03-01T00:00:00Z
	// @Gorg success_cb fmt {"yaml":{"package":"github.com/dovbysh/gin-rest-generator/templates/generated", "cb":"XlsxCb"}, "func":{"cb":"func(c *gin.Context, rows []Row){ c.YAML(http.StatusOK, rows); }"}}
	// @Produce yaml
	GetRowsFromSomething(ctx context.Context, dt time.Time, b bool, i int, s string) ([]Row, error)

	// GetRowsFromSomethingNoSuccessCb documentation
	// @Tags the_tag
	// @Param X-Request-Id header string false "Request-Id"
	// @Router /some-report-no-success-cb/rows [GET]
	// @Gorg param dt tags binding:"required"
	// @Gorg param dt comment Datetime (RFC3339|RFC3339Nano), ex. 2021-03-01T00:00:00Z
	GetRowsFromSomethingNoSuccessCb(ctx context.Context, dt time.Time, b bool, i int, s string) ([]Row, error)

	// GetRowsFromSomethingContextOnly documentation
	// @Param authorization header string false "Authorization: Bearer"
	// @Tags the_tag
	// @Param X-Request-Id header string false "Request-Id"
	// @Router /some-report-context-only/rows [GET]
	GetRowsFromSomethingContextOnly(ctx context.Context) ([]Row, error)

	// GetRowsFromSomethingContextOnlyWithSuccessCb documentation
	// @Param authorization header string false "Authorization: Bearer"
	// @Tags the_tag
	// @Param X-Request-Id header string false "Request-Id"
	// @Router /some-report-context-only-with-success-cb/rows [GET]
	// @Gorg success_cb fmt {"func":{"cb":"func(c *gin.Context, rows []Row){ c.YAML(http.StatusOK, rows); }"}}
	GetRowsFromSomethingContextOnlyWithSuccessCb(ctx context.Context) ([]Row, error)
}

type ItoGenerateRest

type ItoGenerateRest struct {
	Usecase ItoGenerate
}

func NewItoGenerateRest

func NewItoGenerateRest(router *gin.RouterGroup, usecase ItoGenerate) *ItoGenerateRest

type RequestGetRowsFromSomething

type RequestGetRowsFromSomething struct {
	Dt  time.Time `json:"dt" form:"dt" binding:"required"` // Datetime (RFC3339|RFC3339Nano), ex. 2021-03-01T00:00:00Z
	B   bool      `json:"b" form:"b"`
	I   int       `json:"i" form:"i"`
	S   string    `json:"s" form:"s"`
	Fmt string    `json:"fmt" form:"fmt"`
}

type RequestGetRowsFromSomethingContextOnly

type RequestGetRowsFromSomethingContextOnly struct {
}

type RequestGetRowsFromSomethingContextOnlyWithSuccessCb

type RequestGetRowsFromSomethingContextOnlyWithSuccessCb struct {
	Fmt string `json:"fmt" form:"fmt"`
}

type RequestGetRowsFromSomethingNoSuccessCb

type RequestGetRowsFromSomethingNoSuccessCb struct {
	Dt time.Time `json:"dt" form:"dt" binding:"required"` // Datetime (RFC3339|RFC3339Nano), ex. 2021-03-01T00:00:00Z
	B  bool      `json:"b" form:"b"`
	I  int       `json:"i" form:"i"`
	S  string    `json:"s" form:"s"`
}

type Row

type Row struct {
	Id int       `json:"id"`
	F  float64   `json:"f"`
	S  string    `json:"s"`
	Dt time.Time `json:"dt"`
	B  bool      `json:"b"`
}

Jump to

Keyboard shortcuts

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