web

package
v0.0.0-...-c772d2a Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RespOk

func RespOk(rw http.ResponseWriter, result interface{})

Types

type AuditDataGrammarRequest

type AuditDataGrammarRequest struct {
	Filter   bson.M `json:"filter"`
	PageNum  int64  `json:"page_num"`
	PageSize int64  `json:"page_size"`
}

type AuditDataQueryRequest

type AuditDataQueryRequest struct {
	Type string `json:"type"`

	Ip string `json:"ip"`

	PrimaryKey string `json:"primary_key"`

	Timestamp      string `json:"timestamp"`
	Identity       string `json:"identity"`
	OtherCondition bson.M `json:"other_condition"`
	PageNum        int64  `json:"page_num"`
	PageSize       int64  `json:"page_size"`
}

func (*AuditDataQueryRequest) ToFilter

func (request *AuditDataQueryRequest) ToFilter() bson.M

type AuditDataQueryResponse

type AuditDataQueryResponse struct {
	Total int64          `json:"total"`
	Data  []ogws.RawData `json:"data"`
}

type CommonResponse

type CommonResponse struct {
	Message string      `json:"message"`
	Result  interface{} `json:"result"`
}

type HttpListener

type HttpListener struct {
	// contains filtered or unexported fields
}

func NewHttpListener

func NewHttpListener(config HttpListenerConfig, dataProcessor processors.DataProcessor, ledgerWriter backends.LedgerWriter, auditWriter ogws.AuditWriter) *HttpListener

func (*HttpListener) Handle

func (l *HttpListener) Handle(rw http.ResponseWriter, req *http.Request)

func (*HttpListener) Health

func (l *HttpListener) Health(rw http.ResponseWriter, req *http.Request)

func (*HttpListener) Name

func (l *HttpListener) Name() string

func (*HttpListener) Query

func (l *HttpListener) Query(rw http.ResponseWriter, req *http.Request)

func (*HttpListener) QueryGrammar

func (l *HttpListener) QueryGrammar(rw http.ResponseWriter, req *http.Request)

func (*HttpListener) QueryOriginal

func (l *HttpListener) QueryOriginal(rw http.ResponseWriter, req *http.Request)

func (*HttpListener) Start

func (l *HttpListener) Start()

func (*HttpListener) Stop

func (l *HttpListener) Stop()

type HttpListenerConfig

type HttpListenerConfig struct {
	Port             int
	EnableAudit      bool
	EnableHealth     bool
	MaxContentLength int64
}

type OriginalDataQueryResponse

type OriginalDataQueryResponse struct {
	Total int64               `json:"total"`
	Data  []ogws.OriginalData `json:"data"`
}

type OriginalDataRequest

type OriginalDataRequest struct {
	Filter   bson.M `json:"filter"`
	PageNum  int64  `json:"page_num"`
	PageSize int64  `json:"page_size"`
}

Jump to

Keyboard shortcuts

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