Documentation ¶
Index ¶
- Constants
- Variables
- func FormatUintptr(ptr uintptr) string
- func NewRouter(args RouterArgs) *mux.Router
- func ParseUintptr(s string) (uintptr, error)
- type APIRequestHandler
- type APIWorker
- type APIv0
- type Client
- type ClientWithCtx
- func (c *ClientWithCtx) Ctx() context.Context
- func (c ClientWithCtx) GoFunc(logID string, pc uintptr) (f types.GoFunc, err error)
- func (c ClientWithCtx) GoLine(logID string, pc uintptr) (l types.GoLine, err error)
- func (c ClientWithCtx) GoModule(logID string, pc uintptr) (m types.GoModule, err error)
- func (c ClientWithCtx) Goroutines(logID string) (gl chan types.Goroutine, err error)
- func (c ClientWithCtx) LogInfo(id string) (res types.LogInfo, err error)
- func (c ClientWithCtx) Logs() ([]types.LogInfo, error)
- func (c ClientWithCtx) RemoveLog(id string) error
- func (c *ClientWithCtx) Search(id string, query string) (chan<- []string, *errgroup.Group)
- func (c ClientWithCtx) SearchFuncLogs(id string, so SearchFuncLogParams) (<-chan types.FuncLog, *errgroup.Group)
- func (c *ClientWithCtx) SearchRaw(id string, query string) (io.ReadCloser, error)
- func (c ClientWithCtx) Servers() ([]ServerStatus, error)
- func (c ClientWithCtx) SetLogInfo(id string, new types.LogInfo) (updated types.LogInfo, err error)
- func (c *ClientWithCtx) Symbols(logID string) (s *types.Symbols, err error)
- func (c *ClientWithCtx) SyncSymbols(logID string) error
- func (c ClientWithCtx) UpdateLogInfo(id string, tries int, fn func(info *types.LogInfo) error) (types.LogInfo, error)
- type Encoder
- type FuncLogAPIWorker
- type GenericHeap
- type HttpRequestHandler
- type Logs
- type RouterArgs
- type SearchFuncLogParams
- type ServerStatus
- type Servers
- type SortKey
- type SortOrder
Constants ¶
const ( NoSortOrder SortOrder = "" AscendingSortOrder SortOrder = "asc" DescendingSortOrder SortOrder = "desc" NoSortKey SortKey = "" SortByID SortKey = "id" SortByStartTime SortKey = "start-time" SortByEndTime SortKey = "end-time" )
const (
UserAgent = "goapptrace-restapi-client"
)
Variables ¶
Functions ¶
func FormatUintptr ¶
func NewRouter ¶
func NewRouter(args RouterArgs) *mux.Router
func ParseUintptr ¶
Types ¶
type APIRequestHandler ¶
type APIWorker ¶
type APIWorker struct { Api *APIv0 Args *RouterArgs Logger *log.Logger BufferSize int Logobj *storage.Log // contains filtered or unexported fields }
APIのレスポンスの生成を支援するworker。 api.worker() メソッドから作成し APIWorker.wait() で待ち合わせをする。 パイプラインモデルの並列処理を行う。
type APIv0 ¶
type APIv0 struct { RouterArgs Logger *log.Logger }
Goapptrace REST API v0.xのハンドラを提供する
func (APIv0) SetHandlers ¶
type Client ¶
type Client struct { BaseUrl string // contains filtered or unexported fields }
Client helps calling the Goapptrace REST API client.
type ClientWithCtx ¶
func (*ClientWithCtx) Ctx ¶
func (c *ClientWithCtx) Ctx() context.Context
func (ClientWithCtx) Goroutines ¶
func (c ClientWithCtx) Goroutines(logID string) (gl chan types.Goroutine, err error)
func (ClientWithCtx) LogInfo ¶
func (c ClientWithCtx) LogInfo(id string) (res types.LogInfo, err error)
LogInfo returns latest log status
func (ClientWithCtx) Logs ¶
func (c ClientWithCtx) Logs() ([]types.LogInfo, error)
Logs returns a list of log status.
func (ClientWithCtx) RemoveLog ¶
func (c ClientWithCtx) RemoveLog(id string) error
RemoveLog removes the specified log
func (ClientWithCtx) SearchFuncLogs ¶
func (c ClientWithCtx) SearchFuncLogs(id string, so SearchFuncLogParams) (<-chan types.FuncLog, *errgroup.Group)
SearchFuncLogs filters the function call log records.
func (*ClientWithCtx) SearchRaw ¶
func (c *ClientWithCtx) SearchRaw(id string, query string) (io.ReadCloser, error)
SearchRaw execute a SQL query and returns result by CSV format.
func (ClientWithCtx) Servers ¶
func (c ClientWithCtx) Servers() ([]ServerStatus, error)
Servers returns Log server list.
func (ClientWithCtx) SetLogInfo ¶
SetLogInfo updates the log status. If update operation conflicts, it returns ErrConflict.
func (*ClientWithCtx) Symbols ¶
func (c *ClientWithCtx) Symbols(logID string) (s *types.Symbols, err error)
func (*ClientWithCtx) SyncSymbols ¶
func (c *ClientWithCtx) SyncSymbols(logID string) error
SyncSymbolsはサーバからシンボルテーブルをダウンロードし、キャッシュする。 キャッシュを作っておくことで、クライアント側のみでシンボル解決が出来るようになり、高速化が出来る。
func (ClientWithCtx) UpdateLogInfo ¶
func (c ClientWithCtx) UpdateLogInfo(id string, tries int, fn func(info *types.LogInfo) error) (types.LogInfo, error)
UpdateLogInfo updates the log status. When update operation is conflicted, it retries N times.
fn() takes the latest LogInfo and update it. fn() MUST be re-executable because it may be called many times by the API client.
type FuncLogAPIWorker ¶
type FuncLogAPIWorker struct {
// contains filtered or unexported fields
}
type GenericHeap ¶
type GenericHeap struct { LenFn func() int LessFn func(i, j int) bool SwapFn func(i, j int) PushFn func(x interface{}) PopFn func() interface{} }
メソッドの処理を置き換え可能なheap.Interfaceの実装。
func (*GenericHeap) Len ¶
func (h *GenericHeap) Len() int
func (*GenericHeap) Less ¶
func (h *GenericHeap) Less(i, j int) bool
func (*GenericHeap) Pop ¶
func (h *GenericHeap) Pop() interface{}
func (*GenericHeap) Push ¶
func (h *GenericHeap) Push(x interface{})
func (*GenericHeap) Swap ¶
func (h *GenericHeap) Swap(i, j int)
type HttpRequestHandler ¶
type HttpRequestHandler func(w http.ResponseWriter, r *http.Request)
type RouterArgs ¶
type SearchFuncLogParams ¶
type SearchFuncLogParams struct { Gid types.GID MinId types.FuncLogID MaxId types.FuncLogID MinTimestamp types.Time MaxTimestamp types.Time Limit int64 SortKey SortKey SortOrder SortOrder Sql string }
func (*SearchFuncLogParams) FromString ¶
func (s *SearchFuncLogParams) FromString( gid, minId, maxId, minTs, maxTs, limit, sort, order, sql string, ) (invalidParamName string, err error)
func (SearchFuncLogParams) ToParamMap ¶
func (s SearchFuncLogParams) ToParamMap() map[string]string
ToParamMap converts this to url parameters map.
type ServerStatus ¶
type ServerStatus config.LogServerConfig
type Servers ¶
type Servers struct {
Servers []ServerStatus `json:"servers"`
}