fileexperts

package
v1.74.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandle

func NewHandle(caller Caller, opts ...heartbeat.HandleOption) heartbeat.Handle

NewHandle creates a new Handle, which acts like a processing pipeline, with a caller eventually requesting the API.

func RenderFileExperts

func RenderFileExperts(d *FileExperts, out output.Output) (string, error)

RenderFileExperts generates a text representation from file experts of the current day. If out is set to output.RawJSONOutput or output.JSONOutput, the response will be marshaled to JSON. Expects an array of users for the current day. Will return an error otherwise.

Types

type Caller

type Caller interface {
	FileExperts(hh []heartbeat.Heartbeat) ([]heartbeat.Result, error)
}

Caller calls wakatime api to get the file expert.

type Data

type Data struct {
	Total Total `json:"total"`
	User  User  `json:"user"`
}

Data contains the file experts data.

type Entity

type Entity struct {
	Filepath         string  `json:"entity"`
	Project          *string `json:"project"`
	ProjectRootCount *int    `json:"project_root_count"`
}

Entity contains the request for the file-expert endpoint.

type FileExperts

type FileExperts struct {
	Data []Data `json:"data"`
}

FileExperts contains the response for the file_expert endpoint.

type Total

type Total struct {
	Decimal      string  `json:"decimal"`
	Digital      string  `json:"digital"`
	Text         string  `json:"text"`
	TotalSeconds float64 `json:"total_seconds"`
}

Total contains the total time spent on a file.

type User

type User struct {
	ID            string `json:"id"`
	IsCurrentUser bool   `json:"is_current_user"`
	LongName      string `json:"long_name"`
	Name          string `json:"name"`
}

User contains the user information.

Jump to

Keyboard shortcuts

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