dbt

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GinWrapAdService added in v0.0.2

func GinWrapAdService(wrapper AdService, router gin.IRoutes, lock sync.Locker)

Same as Wrap but allows to use your own Gin instance

func WrapAdService added in v0.0.2

func WrapAdService(wrapper AdService, lock sync.Locker) http.Handler

Wrapper of dbt.AdService that expose functions over simple JSON HTTP interface.

Those methods are wrapped: Ping (POST /ping),
ErrorWithoutArgs (POST /error-without-args),
ResultWithoutArgs (POST /result-without-args),
ArgsWithoutResult (POST /args-without-result),
ArgsWithError (POST /args-with-error),
ArgsWithResult (POST /args-with-result)

Types

type Ad struct {
	ID          int64  // Unique ID of ad
	Location    string // Post address of AD
	Description string // Custom description
}

Advertisement item

type AdService

type AdService interface {
	// Simple check availablility
	Ping()
	ErrorWithoutArgs() error
	ResultWithoutArgs() (int64, error)

	ArgsWithoutResult(x, y, z int64, v null.Int, arr []Ad)
	ArgsWithError(x, y, z int64, ad Ad, stamp time.Time, duration time.Duration, value decimal.Decimal, data []byte) error
	ArgsWithResult(x, y, z int64, val sql.NullInt64) (int64, error)
}

Advertisement manager

Jump to

Keyboard shortcuts

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