app

package
v0.0.0-...-76dd3f9 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessLogPath = "./log"
	WwwPath       = "./www"
	RootDataPath  = "./data"
)
View Source
const RootDomain = "asset.unko.in"

Variables

This section is empty.

Functions

func MonitoringHandler

func MonitoringHandler(h http.Handler, rich chan<- ResponseInfo) http.Handler

MonitoringHandler モニタリング用ハンドラ生成

Types

type App

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

func New

func New() *App

func (*App) Run

func (app *App) Run(ctx context.Context) error

type Finance

type Finance struct {
	Chart struct {
		Result []struct {
			Meta struct {
				Currency             string   `json:"currency"`
				Symbol               string   `json:"symbol"`
				ExchangeName         string   `json:"exchangeName"`
				InstrumentType       string   `json:"instrumentType"`
				FirstTradeDate       Unixtime `json:"firstTradeDate"`
				RegularMarketTime    Unixtime `json:"regularMarketTime"`
				Gmtoffset            int64    `json:"gmtoffset"`
				Timezone             string   `json:"timezone"`
				ExchangeTimezoneName string   `json:"exchangeTimezoneName"`
				RegularMarketPrice   float64  `json:"regularMarketPrice"`
				ChartPreviousClose   float64  `json:"chartPreviousClose"`
				PriceHint            int64    `json:"priceHint"`
				CurrentTradingPeriod struct {
					Pre     TradingPeriod `json:"pre"`
					Regular TradingPeriod `json:"regular"`
					Post    TradingPeriod `json:"post"`
				} `json:"currentTradingPeriod"`
				DataGranularity string   `json:"dataGranularity"`
				Range           string   `json:"range"`
				ValidRanges     []string `json:"validRanges"`
			} `json:"meta"`
			Timestamp  []Unixtime `json:"timestamp"`
			Indicators struct {
				Quote []struct {
					Open   []float64 `json:"open"`
					High   []float64 `json:"high"`
					Volume []float64 `json:"volume"`
					Low    []float64 `json:"low"`
					Close  []float64 `json:"close"`
				} `json:"quote"`
				Adjclose []struct {
					Adjclose []float64 `json:"adjclose"`
				} `json:"adjclose"`
			} `json:"indicators"`
		} `json:"result"`
		Error string `json:"error,omitempty"`
	} `json:"chart"`
}

type GetIndicatorHandler

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

func (*GetIndicatorHandler) ServeHTTP

func (h *GetIndicatorHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type GetMonitoringHandler

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

func (*GetMonitoringHandler) ServeHTTP

func (h *GetMonitoringHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Indicator

type Indicator struct {
	Date     Unixtime `json:"date"`
	Open     float64  `json:"open"`
	High     float64  `json:"high"`
	Volume   float64  `json:"volume"`
	Low      float64  `json:"low"`
	Close    float64  `json:"close"`
	Adjclose float64  `json:"adjclose"`
}

type Meta

type Meta struct {
	Currency          string   `json:"currency"`
	Symbol            string   `json:"symbol"`
	ExchangeName      string   `json:"exchangeName"`
	InstrumentType    string   `json:"instrumentType"`
	FirstTradeDate    Unixtime `json:"firstTradeDate"`
	RegularMarketTime Unixtime `json:"regularMarketTime"`
	DataGranularity   string   `json:"dataGranularity"`
	Range             string   `json:"range"`
}

type MonitoringResponseWriter

type MonitoringResponseWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func (*MonitoringResponseWriter) Close

func (mrw *MonitoringResponseWriter) Close() error

Close io.Closerのような感じにしたけど特に意味は無い

func (*MonitoringResponseWriter) Flush

func (mrw *MonitoringResponseWriter) Flush()

Flush http.Flusher interface

func (*MonitoringResponseWriter) Hijack

Hijack implements http.Hijacker. If the underlying ResponseWriter is a Hijacker, its Hijack method is returned. Otherwise an error is returned.

func (*MonitoringResponseWriter) Push

func (mrw *MonitoringResponseWriter) Push(target string, opts *http.PushOptions) error

Push http.Pusher interface go1.8以上が必要

func (*MonitoringResponseWriter) Write

func (mrw *MonitoringResponseWriter) Write(buf []byte) (int, error)

Write メソッドをオーバーライド

func (*MonitoringResponseWriter) WriteHeader

func (mrw *MonitoringResponseWriter) WriteHeader(statusCode int)

WriteHeader メソッドをオーバーライド

type MonitoringResponseWriterWithCloseNotify

type MonitoringResponseWriterWithCloseNotify struct {
	*MonitoringResponseWriter
}

func (*MonitoringResponseWriterWithCloseNotify) CloseNotify

func (mrw *MonitoringResponseWriterWithCloseNotify) CloseNotify() <-chan bool

CloseNotify http.CloseNotifier interface

type ResponseInfo

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

type ResultMonitor

type ResultMonitor struct {
	ResponseTimeSum     time.Duration
	ResponseCount       uint
	ResponseCodeOkCount uint
	ResponseCodeNgCount uint
	// contains filtered or unexported fields
}

type Srv

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

type Store

type Store struct {
	Name       string      `json:"name"`
	Code       string      `json:"code"`
	Type       uint        `json:"type"`
	Meta       Meta        `json:"meta"`
	Indicators []Indicator `json:"indicators"`
}

type TradingPeriod

type TradingPeriod struct {
	Timezone  string   `json:"timezone"`
	Start     Unixtime `json:"start"`
	End       Unixtime `json:"end"`
	Gmtoffset int64    `json:"gmtoffset"`
}

type Unixtime

type Unixtime time.Time

func (Unixtime) MarshalBinary

func (ts Unixtime) MarshalBinary() ([]byte, error)

func (Unixtime) MarshalJSON

func (ts Unixtime) MarshalJSON() ([]byte, error)

func (*Unixtime) UnmarshalBinary

func (ts *Unixtime) UnmarshalBinary(data []byte) error

func (*Unixtime) UnmarshalJSON

func (ts *Unixtime) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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