Documentation
¶
Index ¶
- Variables
- func GenerateMachineId() string
- func GetConfigPath() string
- func GetDiff(path string, staged bool) string
- func GetFilePath(configDir, subDir, fileName string) string
- func GetHttpClient() *http.Client
- func IsFileExists(path string) bool
- func LoadFile(p string) ([]byte, error)
- func LoadFileJson(p string, v interface{}) error
- func Mkdir(path string) error
- func MustJsonBytes(data interface{}) []byte
- func SaveAuthToken(filePath, token, username, clientId string) error
- func SaveFile(p string, data interface{}) error
- func SetCurrentOSName() string
- func StageChanges(path string) error
- type CachedToken
- type GithubUser
- type Headers
- type HttpOptions
- type HttpResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var VERSION_HEADERS = map[string]string{
"editor-version": "Neovim/0.10.4",
"ditor-plugin-version": "lazycopilot/v0.0.1",
"User-Agent": "lazycopilot/v0.0.1",
"sec-fetch-site": "none",
"sec-fetch-mode": "no-cors",
"sec-fetch-dest": "empty",
"priority": "u=4, i",
}
Functions ¶
func GenerateMachineId ¶
func GenerateMachineId() string
func GetConfigPath ¶
func GetConfigPath() string
func GetFilePath ¶
func GetHttpClient ¶
func IsFileExists ¶
func LoadFileJson ¶
func MustJsonBytes ¶
func MustJsonBytes(data interface{}) []byte
func SaveAuthToken ¶
func SetCurrentOSName ¶
func SetCurrentOSName() string
func StageChanges ¶
Types ¶
type CachedToken ¶
type GithubUser ¶
func CheckCachedToken ¶
func CheckCachedToken(filePath, clientId string) (*GithubUser, error)
func FetchGithubUserInfo ¶
func FetchGithubUserInfo(token string) (*GithubUser, error)
type HttpOptions ¶
type HttpResponse ¶
func HttpRequest ¶
func HttpRequest(ctx context.Context, opts HttpOptions) (*HttpResponse, error)
func (*HttpResponse) JsonDecode ¶
func (r *HttpResponse) JsonDecode(v any) error
func (*HttpResponse) StringDecode ¶
func (r *HttpResponse) StringDecode() (string, error)
Click to show internal directories.
Click to hide internal directories.