mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Compare commits
No commits in common. "master" and "0.5.0" have entirely different histories.
@ -413,675 +413,9 @@
|
||||
"name": "Max Beizer",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/2006658?v=4",
|
||||
"profile": "https://www.maxbeizer.com",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "E3V3A",
|
||||
"name": "E:V:A",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/194392?v=4",
|
||||
"profile": "http://tinyurl.com/nwmj4as",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "GaboFDC",
|
||||
"name": "Gabriel",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/1425500?v=4",
|
||||
"profile": "https://github.com/GaboFDC",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "AndrewScibek",
|
||||
"name": "Andrew Scibek",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/10111411?v=4",
|
||||
"profile": "https://github.com/AndrewScibek",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "FriedCosey",
|
||||
"name": "FriedCosey",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/29709822?v=4",
|
||||
"profile": "https://github.com/FriedCosey",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "michelegera",
|
||||
"name": "Michele Gerarduzzi",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/3891?v=4",
|
||||
"profile": "https://michelegera.dev/",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "rudolphjacksonm",
|
||||
"name": "Jack Morris",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/13438569?v=4",
|
||||
"profile": "https://github.com/rudolphjacksonm",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "foorb",
|
||||
"name": "foorb",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/14993807?v=4",
|
||||
"profile": "https://github.com/foorb",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "baberlevi",
|
||||
"name": "Levi Baber",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/5819098?v=4",
|
||||
"profile": "http://researchit.las.iastate.edu",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "gnanderson",
|
||||
"name": "Graham Anderson",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/38514?v=4",
|
||||
"profile": "https://github.com/gnanderson",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "bosr",
|
||||
"name": "Romain Bossart",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/1936828?v=4",
|
||||
"profile": "https://github.com/bosr",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "sosiska",
|
||||
"name": "Kirill Motkov",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/969838?v=4",
|
||||
"profile": "http://eonix.ru",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "Choromanski",
|
||||
"name": "Brian Choromanski",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/3665694?v=4",
|
||||
"profile": "http://www.BrianChoromanski.com",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "Sean-Der",
|
||||
"name": "Sean DuBois",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/1302304?v=4",
|
||||
"profile": "http://siobud.com",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "gary-kim",
|
||||
"name": "Gary Kim",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/47195730?v=4",
|
||||
"profile": "https://github.com/gary-kim",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "DylanBartels",
|
||||
"name": "Dylan",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/6660171?v=4",
|
||||
"profile": "https://dylanbartels.com",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "l13t",
|
||||
"name": "Dmytro Prokhorenkov",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/1990354?v=4",
|
||||
"profile": "http://liet.me",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "elliotrushton",
|
||||
"name": "Elliot",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/590442?v=4",
|
||||
"profile": "https://github.com/elliotrushton",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "chenrui333",
|
||||
"name": "chenrui",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/1580956?v=4",
|
||||
"profile": "http://chenrui.dev",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "sudermanjr",
|
||||
"name": "Andrew Suderman",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/7624765?v=4",
|
||||
"profile": "https://github.com/sudermanjr",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "rwhogg",
|
||||
"name": "Bob 'Wombat' Hogg",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/2373856?v=4",
|
||||
"profile": "https://github.com/rwhogg",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "hxw",
|
||||
"name": "Christopher Hall",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/143462?v=4",
|
||||
"profile": "https://github.com/hxw",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "hneiva",
|
||||
"name": "Heitor Neiva",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/3451557?v=4",
|
||||
"profile": "https://github.com/hneiva",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "herbygillot",
|
||||
"name": "Herby Gillot",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/618376?v=4",
|
||||
"profile": "https://github.com/herbygillot",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "brudil",
|
||||
"name": "James Canning",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/382352?v=4",
|
||||
"profile": "http://brudil.com",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "jeffz",
|
||||
"name": "jeffz",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/45892?v=4",
|
||||
"profile": "https://twitter.com/jeffz4000",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "mikkeljuhl",
|
||||
"name": "Mikkel Jeppesen Juhl",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/1764035?v=4",
|
||||
"profile": "https://mikkeljuhl.com",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "lesteenman",
|
||||
"name": "Erik",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/963290?v=4",
|
||||
"profile": "https://github.com/lesteenman",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "nyourchuck",
|
||||
"name": "Nate Yourchuck",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/155574?v=4",
|
||||
"profile": "https://github.com/nyourchuck",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "Ameobea",
|
||||
"name": "Casey Primozic",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/4335849?v=4",
|
||||
"profile": "https://cprimozic.net/",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "andor-pierdelacabeza",
|
||||
"name": "Alvaro [Andor]",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/2430915?v=4",
|
||||
"profile": "http://pierdelacabeza.com/maruja",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "Midnight-Conqueror",
|
||||
"name": "Joel Valentine",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/17101621?v=4",
|
||||
"profile": "https://github.com/Midnight-Conqueror",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "v-braun",
|
||||
"name": "Viktor Braun",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/4738210?v=4",
|
||||
"profile": "https://www.viktor-braun.de",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "ChrisDBrown",
|
||||
"name": "ChrisDBrown",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/3877652?v=4",
|
||||
"profile": "https://www.chrisdbrown.co.uk/",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "Narengowda",
|
||||
"name": "Narendra L",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/582821?v=4",
|
||||
"profile": "https://narengowda.github.io/",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "ibaum",
|
||||
"name": "ibaum",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/24609103?v=4",
|
||||
"profile": "https://github.com/ibaum",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "noxer",
|
||||
"name": "Tim Scheuermann",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/566185?v=4",
|
||||
"profile": "https://github.com/noxer",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "indradhanush",
|
||||
"name": "Indradhanush Gupta",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/2682729?v=4",
|
||||
"profile": "https://indradhanush.github.io/",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "VictorAvelar",
|
||||
"name": "Victor Hugo Avelar Ossorio",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/7926849?v=4",
|
||||
"profile": "https://victoravelar.com",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "scw007",
|
||||
"name": "Steven Whitehead",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/4001640?v=4",
|
||||
"profile": "https://github.com/scw007",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "lawrencecraft",
|
||||
"name": "Lawrence Craft",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/660580?v=4",
|
||||
"profile": "https://github.com/lawrencecraft",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "aviaviavi",
|
||||
"name": "Avi Press",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/1388071?v=4",
|
||||
"profile": "http://avi.press",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "Tardog",
|
||||
"name": "Sarah Kraßnigg",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/22562624?v=4",
|
||||
"profile": "https://github.com/Tardog",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "jmks",
|
||||
"name": "Jason Schweier",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/4923990?v=4",
|
||||
"profile": "http://jmks.ca",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "massa1240",
|
||||
"name": "Massa",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/8268483?v=4",
|
||||
"profile": "https://github.com/massa1240",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "Boot-Error",
|
||||
"name": "Vighnesh SK",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/8546140?v=4",
|
||||
"profile": "http://boot-error.github.io",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "alexfornuto",
|
||||
"name": "Alex Fornuto",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/2349184?v=4",
|
||||
"profile": "http://alexfornuto.com",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "stevenwhitehead",
|
||||
"name": "stevenwhitehead",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/30630257?v=4",
|
||||
"profile": "https://github.com/stevenwhitehead",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "jdenoy-saagie",
|
||||
"name": "Johan Denoyer",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/55875303?v=4",
|
||||
"profile": "https://github.com/jdenoy-saagie",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "caalberts",
|
||||
"name": "Albert Salim",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/4749355?v=4",
|
||||
"profile": "https://albertsalim.dev",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "felicianotech",
|
||||
"name": "Ricardo N Feliciano",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/6017470?v=4",
|
||||
"profile": "https://Feliciano.Tech",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "3mard",
|
||||
"name": "Omer Davutoglu",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/42009880?v=4",
|
||||
"profile": "https://github.com/3mard",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "hemu",
|
||||
"name": "Hemu",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/1871299?v=4",
|
||||
"profile": "https://github.com/hemu",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "Daanikus",
|
||||
"name": "Dan Bent",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/18027087?v=4",
|
||||
"profile": "https://github.com/Daanikus",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "C123R",
|
||||
"name": "C123R",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/20225764?v=4",
|
||||
"profile": "https://cizer.dev",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "madepolli",
|
||||
"name": "Matjaž Depolli",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/7237000?v=4",
|
||||
"profile": "https://github.com/madepolli",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "schoentoon",
|
||||
"name": "Toon Schoenmakers",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/417618?v=4",
|
||||
"profile": "https://blog.schoentoon.blue",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "TDHTTTT",
|
||||
"name": "TDHTTTT",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/24703459?v=4",
|
||||
"profile": "http://tdhttt.com",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "jottr",
|
||||
"name": "jottr",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/2744198?v=4",
|
||||
"profile": "https://github.com/jottr",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "NickyMateev",
|
||||
"name": "Nikolay Mateev",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/15074116?v=4",
|
||||
"profile": "https://www.linkedin.com/in/nikolay-mateev-79187b167/",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "Gibstick",
|
||||
"name": "Charlie Wang",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/1320418?v=4",
|
||||
"profile": "https://charliewang.io",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "liyiheng",
|
||||
"name": "liyiheng",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/16461061?v=4",
|
||||
"profile": "https://github.com/liyiheng",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "bjoernw",
|
||||
"name": "Bjoern Weidlich",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/1467156?v=4",
|
||||
"profile": "https://bjoern.svbtle.com",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "firecat53",
|
||||
"name": "Scott Hansen",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/568113?v=4",
|
||||
"profile": "https://github.com/firecat53",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "davidsbond",
|
||||
"name": "David Bond",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/6227720?v=4",
|
||||
"profile": "https://davidsbond.github.io",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "yesnault",
|
||||
"name": "Yvonnick Esnault",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/395454?v=4",
|
||||
"profile": "https://github.com/yesnault",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "leterio",
|
||||
"name": "Vinícius Letério",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/15060358?v=4",
|
||||
"profile": "https://github.com/leterio",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "acaloiaro",
|
||||
"name": "Adriano",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/3331648?v=4",
|
||||
"profile": "https://adriano.fyi",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "jonhadfield",
|
||||
"name": "Jon Hadfield",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/843944?v=4",
|
||||
"profile": "https://github.com/jonhadfield",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "Tdnshah",
|
||||
"name": "Tejas Shah",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/13272752?v=4",
|
||||
"profile": "https://github.com/Tdnshah",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "mogensen",
|
||||
"name": "Frederik Mogensen",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/592710?v=4",
|
||||
"profile": "https://github.com/mogensen",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "rsaarelm",
|
||||
"name": "Risto Saarelma",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/41840?v=4",
|
||||
"profile": "https://github.com/rsaarelm",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "sam-github",
|
||||
"name": "Sam Roberts",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/17607?v=4",
|
||||
"profile": "https://sam-github.github.io/",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "gerchardon",
|
||||
"name": "gerchardon",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/5973160?v=4",
|
||||
"profile": "https://github.com/gerchardon",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "mryanmurphy",
|
||||
"name": "Matt",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/641427?v=4",
|
||||
"profile": "https://github.com/mryanmurphy",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "ripienaar",
|
||||
"name": "R.I.Pienaar",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/82342?v=4",
|
||||
"profile": "http://devco.net/",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "fmotrifork",
|
||||
"name": "Frederik Mogensen",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/18327738?v=4",
|
||||
"profile": "https://github.com/fmotrifork",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "aeter",
|
||||
"name": "aeter",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/238607?v=4",
|
||||
"profile": "https://github.com/aeter",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "timhwang21",
|
||||
"name": "Tim Hwang",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/5831434?v=4",
|
||||
"profile": "http://timhwang21.gitbook.io",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "cyingfan",
|
||||
"name": "Ying Fan Chong",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/10404961?v=4",
|
||||
"profile": "http://about.me/yingfan",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "MartinJohns",
|
||||
"name": "Martin Johns",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/5269069?v=4",
|
||||
"profile": "https://github.com/MartinJohns",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "jamietanna",
|
||||
"name": "Jamie Tanna",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/3315059?v=4",
|
||||
"profile": "https://www.jvt.me",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "trimble",
|
||||
"name": "Todd Trimble",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/371317?v=4",
|
||||
"profile": "https://github.com/trimble",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "mhanberg",
|
||||
"name": "Mitchell Hanberg",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/5523984?v=4",
|
||||
"profile": "https://www.mitchellhanberg.com",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "franga2000",
|
||||
"name": "Miha Frangež",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/3891092?v=4",
|
||||
"profile": "https://franga2000.com",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "sahilister",
|
||||
"name": "Sahil Dhiman",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/52946452?v=4",
|
||||
"profile": "https://blog.sahilister.in/",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "applegreengrape",
|
||||
"name": "Pingzhou | 平舟",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/17727004?v=4",
|
||||
"profile": "https://pzoo.netlify.app/",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "YuviGold",
|
||||
"name": "Yuval Goldberg",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/29873449?v=4",
|
||||
"profile": "https://github.com/YuviGold",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "dabcoder",
|
||||
"name": "David Bouchare",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/5034531?v=4",
|
||||
"profile": "https://github.com/dabcoder",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "stone",
|
||||
"name": "Fredrik Steen",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/29077?v=4",
|
||||
"profile": "https://github.com/stone",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "zye1996",
|
||||
"name": "zye1996",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/28901953?v=4",
|
||||
"profile": "https://github.com/zye1996",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "pgaxatte",
|
||||
"name": "Pierre Gaxatte",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/30696904?v=4",
|
||||
"profile": "https://github.com/pgaxatte",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "xntrik",
|
||||
"name": "Christian Frichot",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/678260?v=4",
|
||||
"profile": "https://xntrik.wtf",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "LKaemmerling",
|
||||
"name": "Lukas Kämmerling",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/4281581?v=4",
|
||||
"profile": "https://lukas-kaemmerling.de",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "inetAnt",
|
||||
"name": "Antoine Meillet",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1765366?v=4",
|
||||
"profile": "https://inetant.net/",
|
||||
"contributions": []
|
||||
},
|
||||
{
|
||||
"login": "cclauss",
|
||||
"name": "Christian Clauss",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/3709715?v=4",
|
||||
"profile": "https://www.patreon.com/cclauss",
|
||||
"contributions": [
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 7,
|
||||
"commitConvention": "none"
|
||||
"contributorsPerLine": 7
|
||||
}
|
||||
|
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@ -1 +0,0 @@
|
||||
github: senorprogrammer
|
16
.github/ISSUE_TEMPLATE/Bug.md
vendored
16
.github/ISSUE_TEMPLATE/Bug.md
vendored
@ -1,6 +1,16 @@
|
||||
---
|
||||
name: 🐞 Report a Bug
|
||||
about: Tell us what's broken
|
||||
name: Bug Report
|
||||
about: Something is broken?
|
||||
---
|
||||
|
||||
## What's broken?
|
||||
#### What's the problem?
|
||||
|
||||
|
||||
#### How did you expect it to behave?
|
||||
|
||||
|
||||
#### Operating system
|
||||
|
||||
#### Terminal program & version
|
||||
|
||||
#### WTF version
|
||||
|
11
.github/ISSUE_TEMPLATE/Feature.md
vendored
11
.github/ISSUE_TEMPLATE/Feature.md
vendored
@ -1,6 +1,11 @@
|
||||
---
|
||||
name: ⚡️ Request a Feature
|
||||
about: Tell us what it should do
|
||||
name: Feature Request
|
||||
about: You have a neat idea that should be implemented?
|
||||
---
|
||||
|
||||
## What should it do?
|
||||
#### What problem does this solve?
|
||||
|
||||
|
||||
#### How do envision it working?
|
||||
|
||||
|
||||
|
6
.github/ISSUE_TEMPLATE/Support.md
vendored
6
.github/ISSUE_TEMPLATE/Support.md
vendored
@ -1,8 +1,8 @@
|
||||
---
|
||||
name: ❓Ask a Question
|
||||
about: Tell us how we can help
|
||||
name: ❓ Support Question
|
||||
about: Have a problem that you can't figure out?
|
||||
---
|
||||
|
||||
## How can we help?
|
||||
#### What problem are you having and how can we help?
|
||||
|
||||
|
||||
|
5
.github/PULL_REQUEST_TEMPLATE/Improvement.md
vendored
5
.github/PULL_REQUEST_TEMPLATE/Improvement.md
vendored
@ -3,6 +3,9 @@ name: Improvement
|
||||
about: You have some improvement to make wtf better?
|
||||
---
|
||||
|
||||
Thanks for submitting a pull request. Please provide enough information so that others can review your pull request.
|
||||
#### What problem does this solve?
|
||||
|
||||
|
||||
#### Is this related to an existing Issue? If so, which one?
|
||||
|
||||
|
||||
|
4
.github/PULL_REQUEST_TEMPLATE/Other.md
vendored
4
.github/PULL_REQUEST_TEMPLATE/Other.md
vendored
@ -3,7 +3,9 @@ name: Other
|
||||
about: You have some other ideas you want to introduce?
|
||||
---
|
||||
|
||||
Thanks for submitting a pull request. Please provide enough information so that others can review your pull request.
|
||||
<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. -->
|
||||
|
||||
#### What problem does this solve?
|
||||
|
||||
|
||||
|
||||
|
11
.github/dependabot.yml
vendored
11
.github/dependabot.yml
vendored
@ -1,11 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: gomod
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
open-pull-requests-limit: 10
|
||||
reviewers:
|
||||
- senorprogrammer
|
||||
assignees:
|
||||
- senorprogrammer
|
51
.github/workflows/codeql-analysis.yml
vendored
51
.github/workflows/codeql-analysis.yml
vendored
@ -1,51 +0,0 @@
|
||||
name: "Code scanning - action"
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '0 3 * * 3,6'
|
||||
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
fetch-depth: 2
|
||||
|
||||
# If this run was triggered by a pull request event, then checkout
|
||||
# the head of the pull request instead of the merge commit.
|
||||
- run: git checkout HEAD^2
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
# with:
|
||||
# languages: go, javascript, csharp, python, cpp, java
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
22
.github/workflows/golangci-lint.yml
vendored
22
.github/workflows/golangci-lint.yml
vendored
@ -1,22 +0,0 @@
|
||||
name: golangci-lint
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
jobs:
|
||||
golangci:
|
||||
name: lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v2
|
||||
with:
|
||||
# Required: the version of golangci-lint is required and must be
|
||||
# specified without patch version: we always use the latest patch version.
|
||||
# https://github.com/golangci/golangci-lint/releases
|
||||
version: v1.39
|
||||
args: ./...
|
30
.github/workflows/goreleaser.yml
vendored
30
.github/workflows/goreleaser.yml
vendored
@ -1,30 +0,0 @@
|
||||
name: goreleaser
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
-
|
||||
name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
-
|
||||
name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
70
.github/workflows/staticcheck.yml
vendored
70
.github/workflows/staticcheck.yml
vendored
@ -1,70 +0,0 @@
|
||||
name: static check
|
||||
on: pull_request
|
||||
|
||||
jobs:
|
||||
imports:
|
||||
name: Imports
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: check
|
||||
uses: grandcolline/golang-github-actions@4356d0458ea4bfdb55fcb296437812acef970f9b
|
||||
with:
|
||||
run: imports
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
errcheck:
|
||||
name: Errcheck
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: check
|
||||
uses: grandcolline/golang-github-actions@4356d0458ea4bfdb55fcb296437812acef970f9b
|
||||
with:
|
||||
run: errcheck
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
#lint:
|
||||
#name: Lint
|
||||
#runs-on: ubuntu-latest
|
||||
#steps:
|
||||
#- uses: actions/checkout@master
|
||||
#- name: check
|
||||
#uses: grandcolline/golang-github-actions@4356d04
|
||||
#with:
|
||||
#run: lint
|
||||
#token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
shadow:
|
||||
name: Shadow
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: check
|
||||
uses: grandcolline/golang-github-actions@4356d0458ea4bfdb55fcb296437812acef970f9b
|
||||
with:
|
||||
run: shadow
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
staticcheck:
|
||||
name: StaticCheck
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: check
|
||||
uses: grandcolline/golang-github-actions@4356d0458ea4bfdb55fcb296437812acef970f9b
|
||||
with:
|
||||
run: staticcheck
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
#sec:
|
||||
#name: Sec
|
||||
#runs-on: ubuntu-latest
|
||||
#steps:
|
||||
#- uses: actions/checkout@master
|
||||
#- name: check
|
||||
#uses: grandcolline/golang-github-actions@4356d04
|
||||
#with:
|
||||
#run: sec
|
||||
#token: ${{ secrets.GITHUB_TOKEN }}
|
||||
#flags: "-exclude=G104"
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -19,7 +19,6 @@ gcal/client_secret.json
|
||||
gspreadsheets/client_secret.json
|
||||
profile.pdf
|
||||
report.*
|
||||
.vscode
|
||||
|
||||
# All things node
|
||||
node_modules/
|
||||
|
@ -1,18 +0,0 @@
|
||||
run:
|
||||
timeout: 2m
|
||||
|
||||
linters:
|
||||
enable:
|
||||
- vet
|
||||
- errcheck
|
||||
- staticcheck
|
||||
# - dupl
|
||||
# - funlen
|
||||
# - goconst
|
||||
# - gocritic
|
||||
- gofmt
|
||||
# - golint
|
||||
# - misspell
|
||||
# - stylecheck
|
||||
- unconvert
|
||||
# - whitespace
|
@ -1,30 +1,15 @@
|
||||
env:
|
||||
- GO111MODULE=on
|
||||
- GOPROXY="https://proxy.golang.org,direct"
|
||||
|
||||
archives:
|
||||
- id: default
|
||||
wrap_in_directory: true
|
||||
|
||||
builds:
|
||||
- binary: wtfutil
|
||||
goos:
|
||||
- darwin
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
- arm
|
||||
- arm64
|
||||
|
||||
before:
|
||||
hooks:
|
||||
- make install
|
||||
|
||||
brews:
|
||||
-
|
||||
name: wtfutil
|
||||
homepage: 'https://wtfutil.com'
|
||||
description: 'The personal information dashboard for your terminal.'
|
||||
tap:
|
||||
owner: wtfutil
|
||||
name: homebrew-wtfutil
|
||||
builds:
|
||||
- binary: wtf
|
||||
goos:
|
||||
- darwin
|
||||
- linux
|
||||
goarch:
|
||||
- 386
|
||||
- amd64
|
||||
|
||||
archive:
|
||||
wrap_in_directory: true
|
||||
|
@ -1,14 +1,13 @@
|
||||
language: go
|
||||
|
||||
go:
|
||||
- "1.16.x"
|
||||
|
||||
- "1.10.x"
|
||||
- "1.11.x"
|
||||
sudo: false
|
||||
before_install:
|
||||
# Make sure travis builds work for forks
|
||||
- mkdir -p $TRAVIS_BUILD_DIR $GOPATH/src/github.com/wtfutil
|
||||
- test ! -d $GOPATH/src/github.com/wtfutil/wtf && mv $TRAVIS_BUILD_DIR $GOPATH/src/github.com/wtfutil/wtf || true
|
||||
- export TRAVIS_BUILD_DIR=$HOME/gopath/src/github.com/wtfutil/wtf
|
||||
- cd $HOME/gopath/src/github.com/wtfutil/wtf
|
||||
- export GOPROXY="https://proxy.golang.org,direct"
|
||||
|
||||
script: go get ./... && ./scripts/check-uncommitted-vendor-files.sh && go test -v github.com/wtfutil/wtf/...
|
||||
script: go get ./... && go get github.com/go-test/deep && go test -v github.com/wtfutil/wtf/wtf_tests/...
|
||||
|
584
CHANGELOG.md
584
CHANGELOG.md
@ -4,590 +4,8 @@
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Yahoo Finance module added, by [@inetAnt](https://github.com/inetAnt)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Fixed error closing the Jira module response body, [#1070](https://github.com/wtfutil/wtf/issues/1070) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
|
||||
## v0.36.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* HealthChecks module added, by [@stone](https://github.com/stone)
|
||||
* Asana module added, by [@xntrik](https://github.com/xntrik)
|
||||
* Kubernetes module now displays the Ready Replicas and Total Replicas count, by [@LKaemmerling](https://github.com/LKaemmerling)
|
||||
* Now builds using Go 1.16, which provides support for Apple's M1 ARM hardware, by [@LKaemmerling](https://github.com/LKaemmerling)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Numerous dangling response bodies closed, by [@dabcoder](https://github.com/dabcoder)
|
||||
* HackerNews read-on-response error fixed, by [@LKaemmerling](https://github.com/LKaemmerling)
|
||||
* CircleCI read-on-response error fixed, by [@dabcoder](https://github.com/dabcoder)
|
||||
|
||||
## v0.35.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* CircleCI module now supports `numberOfBuilds` setting defining how many builds to display, [#1020](https://github.com/wtfutil/wtf/issues/1020) by [@dabcoder](https://github.com/dabcoder)
|
||||
* The <kbd>\\</kbd> key now opens module documentation in the browser for the currently-focused module, by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* Krisinformation module added, by [@stone](https://github.com/stone)
|
||||
* Covid module has been added, by [@dabcoder](https://github.com/dabcoder)
|
||||
* Support for a "Language" configuration key added. Supports any BCP 47 tag for identifying a langauge, by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* CryptoLive prices update again, [#1041](https://github.com/wtfutil/wtf/issues/1041) by [@zye1996](https://github.com/zye1996)
|
||||
|
||||
## v0.34.0
|
||||
2020-11-08
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* DigitalOcean module now supports custom column definitions in the default layout. See [the docs](https://wtfutil.com/modules/digitalocean/) for details, [#986](https://github.com/wtfutil/wtf/issues/986) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* Finnhub stock quotes module added, [#930](https://github.com/wtfutil/wtf/issues/930) by [@applegreengrape](https://github.com/applegreengrape)
|
||||
* Grafana Alerts module added, by [@schoentoon](https://github.com/schoentoon)
|
||||
|
||||
### 👍 Updated
|
||||
|
||||
* Updated `google.golang.org/api` from 0.30.0 to 0.33.0
|
||||
* Updated `github.com/digitalocean/godo` from 1.46.0 to 1.52.0
|
||||
* Updated `github.com/xanzy/go-gitlab` from 0.38.1 to 0.39.0
|
||||
* Updated `github.com/zorkian/go-datadog-api` from 2.29.0+incompatible to 2.30.0+incompatible
|
||||
* Updated `golang.org/x/text` from 0.3.3 to 0.3.4
|
||||
|
||||
## v0.33.0
|
||||
2020-10-13
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* FeedReader module supports [display mode switching](https://github.com/wtfutil/wtf/pull/976) via the `t` key, by [@cyingfan](https://github.com/cyingfan)
|
||||
* Clocks module now supports `natural` ordering option, [#896](https://github.com/wtfutil/wtf/issues/896) by [@seanstoppable](https://github.com/Seanstoppable)
|
||||
* Exit banner message added, by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* [UptimeRobot module added](https://github.com/wtfutil/wtf/pull/983), by [@franga2000](https://github.com/franga2000)
|
||||
* Gitlab module now defaults the domain to `https://gitlab.com`, by [@jmks](https://github.com/jmks)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Exchange Rates module now displays rates in alphabetical order, sorted by the base rate, by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* Feed Reader module no longer crashes on feeds that don't have a published date, [#958](https://github.com/wtfutil/wtf/issues/958) by [@cyingfan](https://github.com/cyingfan)
|
||||
* Stray blank lines no longer appear at the end of highlightable lists, [#977](https://github.com/wtfutil/wtf/pull/977) by [@cyingfan](https://github.com/cyingfan)
|
||||
* `config.yml` now properly set to `0600` instead of `0666`, by [@cyingfan](https://github.com/cyingfan)
|
||||
* Now blank-imports the `time/tzinfo` package to provide timezone support for Windows users, [#994](https://github.com/wtfutil/wtf/issues/994) by [@trimble](https://github.com/trimble)
|
||||
|
||||
### 👍 Updated
|
||||
|
||||
* Updated `github.com/gdamore/tcell` from 1.3.0 to 1.4.0
|
||||
* Updated `github.com/shirou/gopsutil` from 2.20.7+incompatible to 2.20.9+incompatible
|
||||
* Updated `github.com/mmcdole/gofeed` from 1.0.0 to 1.1.0
|
||||
* Updated `github.com/digitalocean/godo` from 1.42.1 to 1.46.0
|
||||
* Updated `github.com/xanzy/go-gitlab` from 0.33.0 to 0.38.1
|
||||
* Updated `github.com/adlio/trello` from 1.7.0 to 1.8.0
|
||||
* Updated `github.com/alecthomas/chroma` from 0.8.0 to 0.8.1
|
||||
* Updated `github.com/nicklaw5/helix` from 0.5.9 to 0.7.0
|
||||
|
||||
* Now requires Go 1.15 for compilation in Dockerfiles and go.mod, by [@seanstoppable](https://github.com/Seanstoppable)
|
||||
|
||||
## v0.32.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* PagerDuty module now supports `showOncallEnd` setting, which determines whether or not to display the oncall rotation end date, by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* Exchange Rates module now supports `precision` setting, which determines how many decimal places to display, [#897](https://github.com/wtfutil/wtf/issues/897) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Todo module's edit modal now shows up quickly, [#876](https://github.com/wtfutil/wtf/issues/876) by [@aeter](https://github.com/aeter)
|
||||
* Jira module title now displays properly, [#942](https://github.com/wtfutil/wtf/issues/942) by [@timhwang21](https://github.com/timhwang21)
|
||||
|
||||
### 👍 Updated
|
||||
|
||||
* Updated `alecthomas/chroma` from 0.7.3 to 0.8.0
|
||||
* Updated `digitalocean/godo` from 1.38.0 to 1.42.1
|
||||
* Updated `google.golang.org/api` from 0.29.0 to 0.30.0
|
||||
* Updated `shirou/gopsutil` from 2.20.6+incompatible to 2.20.7+incompatible
|
||||
|
||||
## v0.31.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* [docker-credential-helpers](https://github.com/docker/docker-credential-helpers) support added to provide optional securing of module secrets, [#517](https://github.com/wtfutil/wtf/issues/517) by [@sam-github](https://github.com/sam-github)
|
||||
* `make lint` now uses [golangci-lint](https://github.com/golangci/golangci-lint-action), by [@sam-github](https://github.com/sam-github)
|
||||
* GitHub module now supports per-section configuration, [#864](https://github.com/wtfutil/wtf/issues/864) by [@mryanmurphy](https://github.com/mryanmurphy)
|
||||
* PagerDuty module now accepts Team ID and User ID as filters, by [@mryanmurphy](https://github.com/mryanmurphy)
|
||||
* Weather module now supports a `useEmoji` setting, toggling the use of emoji characters in the title, by [@jonhadfield](https://github.com/jonhadfield)
|
||||
* Pocket documentation added, by [@3mard](https://github.com/3mard)
|
||||
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* GitLab Todo module now allows domain to be set, defaults to `https://gitlab.com`, by [@gerchardon](https://github.com/gerchardon)
|
||||
* Pi-hole module now works with Pi-hole v4 and v5, by [@jonhadfield](https://github.com/jonhadfield)
|
||||
* Null pointer exception fixed in VictorOps module, by [@ripienaar](https://github.com/ripienaar)
|
||||
|
||||
### 👍 Updated
|
||||
|
||||
* Updated `google.golang.org/api` from 0.25.0 to 0.29.0
|
||||
* Updated `pkg/profile` from 1.4.0 to 1.5.0
|
||||
* Updated `nicklaw5/helix` from 0.5.8 to 0.5.9
|
||||
* Updated `digitalocean/godo` from 1.37.0 to 1.38.0
|
||||
* Updated `gopkg.in/yaml.v2` from 2.2.8 to 2.3.0
|
||||
* Updated `xanzy/go-gitlab` from 0.31.0 to 0.33.0
|
||||
* Updated `stretchr/testify` from 1.5.1 to 1.6.1
|
||||
* Updated `golang.org/x/text` from 0.3.2 to 0.3.3
|
||||
* Updated `shirou/gopsutil` from 2.20.4+incompatible to 2.20.6+incompatible
|
||||
|
||||
## v0.30.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Expansive keyboard controls for the [GitLab](https://wtfutil.com/modules/gitlab/) module, by [@mogensen](https://github.com/mogensen)
|
||||
* [IPInfo](https://wtfutil.com/modules/ipaddress/ipinfo/) module now supports IPv6 lookup, by [@acaloiaro](https://github.com/acaloiaro)
|
||||
* The GitHub repo now runs a set of actions that lint PRs for code quality and conformity and comment in-line on the PRs. See here for action details https://github.com/wtfutil/wtf/actions
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Random capital letters around display, [#811](https://github.com/wtfutil/wtf/issues/811) by [@jonhadfield](https://github.com/jonhadfield)
|
||||
* [Feed Reader](https://wtfutil.com/modules/feedreader/) module now properly sorts multi-feed items by date, by [@rsaarelm](https://github.com/rsaarelm)
|
||||
|
||||
### 👍 Updated
|
||||
|
||||
* Updated `zorkian/go-datadog-api` from 2.28.0+incompatible to 2.29.0+incompatible
|
||||
* Updated `shirou/gopsutil` from 2.20.3+incompatible to 2.20.4+incompatible
|
||||
* Updated `google.golang.org/api` from 0.22.0 to 0.23.0
|
||||
|
||||
## 0.29.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* gCal module now has a `showEndTime` boolean option for displaying meeting end times, by [@acaloiaro](https://github.com/acaloiaro)
|
||||
* [Pi-hole](https://wtfutil.com/modules/pihole/) module added, by [@jonhadfield](https://github.com/jonhadfield)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Docker module subheading display, [#847](https://github.com/wtfutil/wtf/issues/847) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* Improved display of currencies for the Exchange Rate module, by [@indradhanush](https://github.com/indradhanush)
|
||||
|
||||
### 👍 Updated
|
||||
|
||||
* Updated `nicklaw5/helix` from 0.5.7 to 0.5.8
|
||||
* Updated `digitalocean/godo` from 1.34.0 to 1.35.1
|
||||
* Updated `xanzy/go-gitlab` from 0.28.0 to 0.31.0
|
||||
* Updated `shirou/gopsutil` from 2.20.2+incompatible to 2.20.3+incompatible
|
||||
* Updated `alecthomas/chroma` from 0.7.1 to 0.7.2
|
||||
* Updated `google.golang.org/api` from 0.21.0 to 0.22.0
|
||||
|
||||
## v0.28.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Support for customizing CPU, Mem, and Swap display in ResourceUsage, by [@leterio](https://github.com/leterio)
|
||||
|
||||
### 👍 Updated
|
||||
|
||||
* Now prefers Go 1.14 for compilation (should still work under 1.13 however)
|
||||
* Updated `shirou/gopsutil` from 2.20.1+incompatible to 2.20.2+incompatible
|
||||
* Updated `google.golang.org/api` from 0.17.0 to 0.20.0
|
||||
* Updated `digitalocean/godo` from 1.30.0 to 1.32.0
|
||||
* Updated `xanzy/go-gitlab` from 0.26.0 to 0.28.0
|
||||
* Updated `adlio/trello` from 1.6.0 to 1.7.0
|
||||
* Updated `zorkian/go-datadog-api` from 2.27.0+incompatible to 2.28.0+incompatible
|
||||
|
||||
## 0.27.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* GitLab Todo module added, by [@elliotrushton](https://github.com/elliotrushton)
|
||||
* [CDS](https://wtfutil.com/modules/cds/) module added, by [@yesnault](https://github.com/yesnault)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* The `vendor` directory has been removed, [#792](https://github.com/wtfutil/wtf/issues/792) by [@bjoernw](https://github.com/bjoernw)
|
||||
|
||||
### 👍 Updated
|
||||
|
||||
* Updated `zorkian/go-datadog-api` from 2.26.0+incompatible to 2.27.0+incompatible
|
||||
* Updated `google.golang.org/api` from 0.15.0 to 0.17.0
|
||||
* Updated `github.com/nicklaw5/helix` from 0.5.5 to 0.5.7
|
||||
* Updated `xanzy/go-gitlab` from 0.23.0 to 0.26.0
|
||||
* Updated `stretchr/testify` from o.4.0 to 0.5.1
|
||||
|
||||
## 0.26.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* `myName` config setting added to PagerDuty module, by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* `withDate` config setting added to Digital Clock module, by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* Twitch module added, by [@bjoernw](https://github.com/bjoernw)
|
||||
* HackerNews module now opens HN comments when there is no alternative external link, [#758](https://github.com/wtfutil/wtf/issues/758) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* gCal module now now allows users to hide all-day events, [#733](https://github.com/wtfutil/wtf/issues/733) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* SpaceX module added, by [@bjoernw](https://github.com/bjoernw)
|
||||
* Support for obeying `XDG_CONFIG_HOME` when set, [#699](https://github.com/wtfutil/wtf/issues/699) by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Module templating working again, [#748](https://github.com/wtfutil/wtf/issues/748) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* CmdRunner title spacing issue fixed, [#784](https://github.com/wtfutil/wtf/issues/784) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* Colors in cmdrunner fixed when using nodejs chalk et al., [#618](https://github.com/wtfutil/wtf/issues/618) by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* Docker buid instructions updated and improved, by [@firecat53](https://github.com/firecat53)
|
||||
* Kubernetes module can now be used with multiple contexts, [#809](https://github.com/wtfutil/wtf/issues/809) by [@davidsbond](https://github.com/davidsbond)
|
||||
|
||||
### 👍 Updated
|
||||
|
||||
* Updated `digitalocean/godo` from 1.22.0 to 1.30.0
|
||||
* Updated `google.golang.org/api` from 0.14.0 to 0.15.0
|
||||
* Updated `alecthomas/chroma` from 0.7.0 to 0.7.1
|
||||
* Updated `pkg/errors` from 0.8.1 to 0.9.1
|
||||
* Updated `xanzy/go-gitlab` from 0.22.2 to 0.23.0
|
||||
* Updated `shirou/gopsutil` from 2.19.11 to 2.20.1
|
||||
* Updated `zorkian/go-datadog-api` from 2.25.0 to 2.26.0
|
||||
* Updated `gopkg.in/yaml.v2` from 2.2.7 to 2.2.8
|
||||
* Updated `nicklaw5/helix` from 0.5.4 to 0.5.5
|
||||
|
||||
## 0.25.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* [DigitalOcean](https://wtfutil.com/modules/digitalocean/) module added, by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* [Transmission](https://wtfutil.com/modules/transmission/) module now supports a `hideComplete` configuration setting, by [@schoentoon](https://github.com/schoentoon)
|
||||
* Pocket module added, [#742] by [@3mard](https://github.com/3mard)
|
||||
* [Exchange Rates](https://wtfutil.com/modules/exchange_rates/) module added, by [@schoentoon](https://github.com/schoentoon)
|
||||
* [GitHub](https://wtfutil.com/modules/github/) modules supports 'p' keyboard command to open **p**ull requests, by [@NickyMateev](https://github.com/NickyMateev)
|
||||
* [GitHub](https://wtfutil.com/modules/github/) modules supports 'i' keyboard command to open **i**ssues, by [@NickyMateev](https://github.com/NickyMateev)
|
||||
* [Jenkins](https://wtfutil.com/modules/jenkins/) module now supports multi-configuration projects, by [@NickyMateev](https://github.com/NickyMateev)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Subreddit out of bounds error fixed, [#753](https://github.com/wtfutil/wtf/issues/753) by [@TDHTTTT](https://github.com/TDHTTTT)
|
||||
* Homebrew builds now contain version information, [#557](https://github.com/wtfutil/wtf/issues/557) by [@jottr](https://github.com/jottr)
|
||||
* CmdRunner flicker problem, [#732](https://github.com/wtfutil/wtf/issues/732) by [@Gibstick](https://github.com/Gibstick)
|
||||
|
||||
### 👍 Updated
|
||||
|
||||
* Switched from `gocenter.io` as the Go proxy to `proxy.golang.org`, by [@chenrui333](https://github.com/chenrui333)
|
||||
* Updated `go-datadog-api` to version 2.25.0+incompatible
|
||||
* Updated `adlio/trello` to version 1.6.0
|
||||
* Updated `alecthomas/chroma` to version 0.7.0
|
||||
* Updated `olekukonko/tablewriter` to version 0.0.3
|
||||
* Updated `pkg/profile` to version 1.4.0
|
||||
* Updated `yaml.v2` to 2.2.7
|
||||
* Updated `google.golang.org/api` to 0.14.0
|
||||
* Updated `xanzy/go-gitlab` to 0.22.2
|
||||
* Uodated `shirou/gopsutil` to 2.19.11+incompatible
|
||||
|
||||
|
||||
## v0.24.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Proper, usable [Docker file](https://github.com/wtfutil/wtf/blob/master/Dockerfile) added, by [@Boot-Error](https://github.com/Boot-Error)
|
||||
* [GitLab](https://wtfutil.com/modules/gitlab/) module displays issues assigned to, and opened by, the user, by [@caalberts](https://github.com/caalberts)
|
||||
* [TravisCI](https://wtfutil.com/modules/travisci/) now checks for uncommitted vendor changes, by [@indradhanush](https://github.com/indradhanush)
|
||||
* Football module added, by [@C123R](https://github.com/C123R)
|
||||
* [resourceuseage](https://wtfutil.com/modules/resourceusage/) now supports a `cpuCombined` setting, by [@madepolli](https://github.com/madepolli)
|
||||
* [Twitter Stats](https://wtfutil.com/modules/twitter/twittertweets/) module added, by [@Ameobea](https://github.com/Ameobea)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Github PRs do not count against issues, by [@alexfornuto](https://github.com/alexfornuto)
|
||||
* Todo scrolling now works properly, [#707](https://github.com/wtfutil/wtf/issues/707) by [3mard](https://github.com/3mard)
|
||||
* Configs with a missing `color` key now load properly, [#718](https://github.com/wtfutil/wtf/issues/718) and [#730](https://github.com/wtfutil/wtf/issues/730) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
|
||||
## 0.23.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* [Azure DevOps](https://wtfutil.com/modules/azure-devops/) module added, by [@v-braun](https://github.com/v-braun)
|
||||
* [Dev.to](https://wtfutil.com/modules/devto/) module added, by [@VictorAvelar](https://github.com/VictorAvelar)
|
||||
* [TravisCI]() module now supports enterprise endpoints, [#652](https://github.com/wtfutil/wtf/issues/652) by [@scw007](https://github.com/scw007)
|
||||
* [Subreddit](https://wtfutil.com/modules/subreddit/) module added, by [@lawrencecraft](https://github.com/lawrencecraft)
|
||||
* [gCal](https://wtfutil.com/modules/google/gcal/) module now supports a `hourFormat` setting for defining whether to display 12 or 24-hour times, [#665](https://github.com/wtfutil/wtf/issues/665) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* [Scarf](https://scarf.sh) installation instructions added to README, by [@aviaviavi](https://github.com/aviaviavi)
|
||||
* Spotify widget now supports colour themes, [#659](https://github.com/wtfutil/wtf/issues/659) by [@Tardog](https://github.com/Tardog)
|
||||
* [Buildkite](https://wtfutil.com/modules/buildkite/) module added, by [@jmks](https://github.com/jmks)
|
||||
* [Improvements](https://github.com/wtfutil/wtf/pull/680) to the [CmdRunner](https://wtfutil.com/modules/cmdrunner/) module, by [@noxer](https://github.com/noxer)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* gCal calendar event time colour can now be changed by setting the `eventTime` configuration setting, [#638](https://github.com/wtfutil/wtf/issues/638) by [@indradhanush](https://github.com/indradhanush)
|
||||
* [Clocks](https://wtfutil.com/modules/clocks/) now obeys global row colour settings, [#658](https://github.com/wtfutil/wtf/issues/658) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* [Transmission](https://wtfutil.com/modules/transmission/) module no longer blocks rendering when a Transmission daemon cannot be found, [#661](https://github.com/wtfutil/wtf/issues/661) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* [Trello](https://wtfutil.com/modules/trello/) module now respects project list order, [#664](https://github.com/wtfutil/wtf/issues/664) by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* [Todo](https://wtfutil.com/modules/todo/) module now respects checkbox settings, [#616](https://github.com/wtfutil/wtf/issues/616) by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* [Todoist](https://wtfutil.com/modules/todoist/) module now properly handles todo items with due date and times, [#645](https://github.com/wtfutil/wtf/issues/645) by [@massa1240](https://github.com/massa1240)
|
||||
* Invalid pointer error in [Azure DevOps](https://wtfutil.com/modules/azure-devops/) fixed by [@Boot-Error](https://github.com/Boot-Error)
|
||||
* Renamed slice error in [Dev](https://wtfutil.com/modules/devto/) fixed by [@Boot-Error](https://github.com/Boot-Error)
|
||||
|
||||
### 👍 Updated
|
||||
|
||||
* Updated `go-datadog-api` to version v2.24.0
|
||||
* Updated `go-github` to version 26.13
|
||||
* Updated `watcher` to version 1.0.7
|
||||
* Updated `google-api-go-client` to version 0.10.0
|
||||
* Updated `chroma` to version 0.6.7
|
||||
* Updated `go-gitlab` to version 0.20.1
|
||||
* Updated `trello` to version 1.4.0
|
||||
* Updated `tcell` to version 1.3.0
|
||||
* Updated `gopsutil` to version 2.19.9+incompatible
|
||||
* Updated `yaml` to version 2.2.4
|
||||
|
||||
## v0.22.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* [Arpansagovau](https://wtfutil.com/modules/weather_services/arpansagovau/) (arpansa.gov.au) module added, by [@jeffz](https://github.com/jeffz)
|
||||
* 'calendarReadLevel' setting added to gCal module, by [@mikkeljuhl](https://github.com/mikkeljuhl)
|
||||
* Todoist module now catches and displays API errors, by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* TravisCI sort orders now configurable, by [@nyourchuck](https://github.com/nyourchuck)
|
||||
* Google Analytics module now supports real-time metrics, [#581](https://github.com/wtfutil/wtf/issues/581) by [@Ameobea](https://github.com/Ameobea)
|
||||
* Colors in configuration can now be defined using long-form hex, i.e.: #ff0000, by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* GitHub module pull requests are now selectable and openable via keyboard, [#547](https://github.com/wtfutil/wtf/issues/547) by [@Midnight-Conqueror](https://github.com/Midnight-Conqueror)
|
||||
* [Docker](https://wtfutil.com/modules/docker/) module added, [#594](https://github.com/wtfutil/wtf/issues/594) by [@v-braun](https://github.com/v-braun)
|
||||
* NewRelic module now supports displaying data from multiple apps, [#471](https://github.com/wtfutil/wtf/issues/471) by [@ChrisDBrown](https://github.com/ChrisDBrown) and [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* [Digital Clock](https://wtfutil.com/modules/digitalclock/) module added, by [@Narengowda](https://github.com/Narengowda)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* ScrollableWidget bounds checking error fixed, [#578](https://github.com/wtfutil/wtf/issues/578) by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* Now properly URL-decodes Jenkins branch names, [#575](https://github.com/wtfutil/wtf/issues/575) by [@lesteenman](https://github.com/lesteenman)
|
||||
* Jira column sizes render properly, [#574](https://github.com/wtfutil/wtf/issues/574) by [@lesteenman](https://github.com/lesteenman)
|
||||
* Todoist module updated to latest API version, by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* gCal colour highlighting working again, [#611](https://github.com/wtfutil/wtf/issues/611) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* Per-module background and text colour settings working again, [#568](https://github.com/wtfutil/wtf/issues/568) by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* Git module no longer forces sorting of repositories, [#608](https://github.com/wtfutil/wtf/pull/608) by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* GitHub PR icons render properly without phantom characters, by [@Midnight-Conqueror](https://github.com/Midnight-Conqueror)
|
||||
* GitLab configuration now takes a list of project paths, [#566](https://github.com/wtfutil/wtf/issues/566) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* Kubernetes configuration segfault fixed, [#549](https://github.com/wtfutil/wtf/issues/549) by [@ibaum](https://github.com/ibaum)
|
||||
|
||||
## v0.21.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Power Soure module support added for FreeBSD, by [@hxw](https://github.com/hxw)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Power indicator displays ∞ on Linux when fully-charged and on AC power, [#534](https://github.com/wtfutil/wtf/issues/534) by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* Default background color is now the terminal background color, making transparency support possible in MacOS and Linux, by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* `xdg-open` now used as the opener for HTTP/HTTPS by default, by [@hxw](https://github.com/hxw)
|
||||
* Transmission port over-ride now working, [#565](https://github.com/wtfutil/wtf/issues/565) by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* Default config is now created on first run, [#553](https://github.com/wtfutil/wtf/issues/553) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
|
||||
## v0.20.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Kubernetes module added, [#142](https://github.com/wtfutil/wtf/issues/142) by [@sudermanjr](https://github.com/sudermanjr)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Tab and Esc keys work properly in modal dialogs, [#520](https://github.com/wtfutil/wtf/issues/520) by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* `wtfutil -m` flag now works with non-enabled modules, [#529](https://github.com/wtfutil/wtf/issues/529) by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* Jenkins job filtering preserved across redraws, [#532](https://github.com/wtfutil/wtf/issues/532) by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
|
||||
## v0.19.1
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Dockerfile, by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* Add build targets for arm and arm64 architectures, by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
|
||||
## v0.19.0
|
||||
|
||||
### ☠️ Breaking Change
|
||||
|
||||
* HIBP module now requires an API key to operate. See [Authentication and the Have I Been Pwned API](https://www.troyhunt.com/authentication-and-the-have-i-been-pwned-api/) for more details, [#508](https://github.com/wtfutil/wtf/issues/508) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* OpsGenie module now supports "region" configuration option ("us" or "eu"), by [@l13t](https://github.com/l13t)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Fixes the error message shown when an explicitly-specified custom config file cannot be found or cannot be read, by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* Rollbar module works again, [#507](https://github.com/wtfutil/wtf/issues/507) by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* The default config that gets installed on first run is much improved, [#504](https://github.com/wtfutil/wtf/issues/504) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
* Default config file is now `chmod 0600` to ensure only the owning user can read it, by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
|
||||
## v0.18.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Google Analytics module, by [@DylanBartels](https://github.com/DylanBartels)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Now created ~/.config if that directory is missing, [#510](https://github.com/wtfutil/wtf/issues/510) by [@senorprogrammer](https://github.com/senorprogrammer)
|
||||
|
||||
## v0.17.1
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Fixes an issue in which the default config file was not being created on first run
|
||||
|
||||
## v0.17.0
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* FeedReader story sorting bug fixed
|
||||
* NewRelic dependency vendored
|
||||
|
||||
## v0.16.1
|
||||
## v0.16.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Config and recipe added for installing via Homebrew
|
||||
|
||||
## v0.15.0
|
||||
|
||||
### ❗️Changed
|
||||
|
||||
* The installed binary has been renamed from `wtf` to `wtfutil`. [Read more about it here](https://wtfutil.com/blog/2019-07-10-wtfutil-release/).
|
||||
|
||||
## v0.14.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* CmdRunner module now supports custom titles, by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* FeedReader module added (https://wtfutil.com/modules/feedreader/), a rudimentary Rss & Atom feed reader
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Cryptolive module works again, [#481](https://github.com/wtfutil/wtf/issues/481) by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* gCal module now supports setting an explicit time zone via the "timezone" config attribute, [#382](https://github.com/wtfutil/wtf/issues/382) by [@jeangovil](https://github.com/jeangovil)
|
||||
* Misconfigured module positions in `config.yaml` now attempt to provide informative error messages on launch, [#482](https://github.com/wtfutil/wtf/issues/482)
|
||||
|
||||
## v0.13.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Transmission module addedd (https://wtfutil.com/modules/transmission/)
|
||||
|
||||
## v0.12.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Textfile module's text wrapping is configurable via the 'wrapText' boolean setting
|
||||
* Have I Been Pwned (HIBP) module added (https://wtfutil.com/modules/hibp/)
|
||||
|
||||
## v0.11.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* GitHub module now supports custom queries for issues and pull requests, by [@Sean-Der](https://github.com/Sean-Der)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Todoist now properly updates list items when Refresh is called
|
||||
* Keyboard modal displays properly when tabbing between widgets, [#467](https://github.com/wtfutil/wtf/issues/467)
|
||||
|
||||
## v0.10.3
|
||||
|
||||
### ❗️Changed
|
||||
|
||||
* Invalid glog dependency removed, by [@bosr](https://github.com/bosr)
|
||||
|
||||
## v0.10.2
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Weather module no longer crashes if there's no weather data or no internet connection
|
||||
* Gitlab no longer prevents installing with missing param, [#455](https://github.com/wtfutil/wtf/issues/455)
|
||||
|
||||
## v0.10.1
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Trello now displays multiple lists properly, [#454](https://github.com/wtfutil/wtf/issues/454)
|
||||
|
||||
## v0.10.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* DataDog module is now scrollable and interactive, by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* Focusable hot key numbers are now assigned in a stable order, [#435](https://github.com/wtfutil/wtf/issues/435) by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* Zendesk widget now has help text, by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* Scrollable widget added to provide common keyboard-navigation list functionality, by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* Logging functionality extracted out from Log module, by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* Improved sample configs with up-to-date attributes and examples, by [@retgits](https://github.com/retgits)
|
||||
* PagerDuty config now supports schedule filtering using the `scheduleIDs` config option, by [@senporprogrammer](https://github.com/senporprogrammer)
|
||||
|
||||
## v0.9.2
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Keyboard management system for modules reworked. Now has a KeyboardWidget to simplify adding keyboard commands
|
||||
|
||||
### Fixed
|
||||
|
||||
* WTF versions are now prefixed with `v` again so module systems pick up the latest versions
|
||||
|
||||
## 0.9.1
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Increased the pagination limit for GitHub to 100, by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* Support for multiple instances of the same widget added, by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
|
||||
## 0.9.0
|
||||
|
||||
* Null release
|
||||
|
||||
## 0.8.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Dependencies are now managed and installed using Go modules. See README.md for details, [#406](https://github.com/wtfutil/wtf/issues/406) by [@retgits](https://github.com/retgits)
|
||||
|
||||
## 0.7.2
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* NBA Scores now navigable via arrow keys, [#415](https://github.com/wtfutil/wtf/issues/415)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Multi-page sigils off-by-one error fixed, [#413](https://github.com/wtfutil/wtf/issues/413)
|
||||
* Many points of potential and probable race conditions have been improved to not have race conditions. WTF should be quite a bit more stable now
|
||||
* In the Twitter module, the following have been fixed:
|
||||
* Help text says "Twitter" instead of "TextFile"
|
||||
* Keyboard-command "o" opens the current Twitter handle in the browser
|
||||
* Keyboard-command "o" is documented in the help text
|
||||
|
||||
## 0.7.1
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* HackerNews row selections are visible again, [#411](https://github.com/wtfutil/wtf/issues/411)
|
||||
|
||||
## 0.7.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Jenkins now supports coloured balls, [#358](https://github.com/wtfutil/wtf/issues/358) by [@rudolphjacksonm](https://github.com/rudolphjacksonm)
|
||||
* Jenkins now supports regular expressions, [#359](https://github.com/wtfutil/wtf/issues/359) by [@rudolphjacksonm](https://github.com/rudolphjacksonm)
|
||||
* Complete refactoring of the module settings system, reducing the dependency on `config` and making it possible to configure modules by other means, by [@senporprogrammer](https://github.com/senporprogrammer)
|
||||
|
||||
## 0.6.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Jira widget navigable via up/down arrow keys, by [@jdenoy](https://github.com/jdenoy)
|
||||
* Windows security module improved, by [@E3V3A](https://github.com/E3V3A)
|
||||
* Function modules moved into the `/modules` directory, by [@Seanstoppable](https://github.com/Seanstoppable)
|
||||
* NBA Score module added by [@FriedCosey](https://github.com/FriedCosey)
|
||||
|
||||
### 🐞 Fixed
|
||||
|
||||
* Now displays an error on start-up if a widget has mis-configured `position` attributes ([#389](https://github.com/wtfutil/wtf/issues/389) by @senporprogrammer)
|
||||
|
||||
## 0.5.0
|
||||
|
||||
### ⚡️ Added
|
||||
|
||||
* Resource Usage module added by [@nicholas-eden](https://github.com/nicholas-eden)
|
||||
* Recursive repo search in Git module ([#126](https://github.com/wtfutil/wtf/issues/126) by [@anandsudhir](http://github.com/anandsudhir))
|
||||
* Recursive repo search in Git module ([#126](https://github.com/wtfutil/wtf/issues/126) by [@anandsudhir](http://github.com/anandsudhir))
|
||||
* HTTP/HTTPS handling in OpenFile() util function by [@jdenoy](https://github.com/jdenoy)
|
||||
* Honor system http proxies when using non-default transport by [@skymeyer](https://github.com/skymeyer)
|
||||
* VictorOps module added by [ImDevinC](https://github.com/ImDevinC)
|
||||
|
@ -1,13 +1,17 @@
|
||||
# Contributing
|
||||
|
||||
When contributing to this repository, please first discuss the change you wish to make via issue,
|
||||
email, or any other method with the owners of this repository before making a change.
|
||||
|
||||
Note that we have a code of conduct. Please follow it in all your interactions with the project.
|
||||
|
||||
## Pull Request Process
|
||||
|
||||
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
|
||||
build.
|
||||
2. Update the static documentation with details of changes to the interface, this includes new environment
|
||||
variables, useful file locations and configuration parameters.
|
||||
|
||||
Documentation lives at [wtfdocs](https://github.com/wtfutil/wtfdocs) and is a [Hugo](https://gohugo.io) app. See Hugo's documentation for usage.
|
||||
Documentation lives in the `_site` directory and is a [Hugo](https://gohugo.io) app. See Hugo's documentation for usage.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
@ -66,7 +70,7 @@ further defined and clarified by project maintainers.
|
||||
### Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project owner at chriscummer@me.com. All
|
||||
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
|
26
Dockerfile
26
Dockerfile
@ -1,26 +0,0 @@
|
||||
FROM golang:1.16-alpine as build
|
||||
|
||||
ARG version=master
|
||||
|
||||
RUN apk add git make ncurses && \
|
||||
git clone https://github.com/wtfutil/wtf.git $GOPATH/src/github.com/wtfutil/wtf && \
|
||||
cd $GOPATH/src/github.com/wtfutil/wtf && \
|
||||
git checkout $version
|
||||
|
||||
ENV GOPROXY=https://proxy.golang.org,direct
|
||||
ENV GO111MODULE=on
|
||||
ENV GOSUMDB=off
|
||||
|
||||
WORKDIR $GOPATH/src/github.com/wtfutil/wtf
|
||||
|
||||
ENV PATH=$PATH:./bin
|
||||
|
||||
RUN make build
|
||||
|
||||
FROM alpine
|
||||
|
||||
COPY --from=build /go/src/github.com/wtfutil/wtf/bin/wtfutil /usr/local/bin/
|
||||
RUN adduser -h /config -DG users -u 20000 wtf
|
||||
|
||||
USER wtf
|
||||
ENTRYPOINT ["wtfutil"]
|
@ -1,18 +0,0 @@
|
||||
FROM golang:1.16 as build
|
||||
|
||||
ARG version=master
|
||||
|
||||
RUN git clone https://github.com/wtfutil/wtf.git $GOPATH/src/github.com/wtfutil/wtf && \
|
||||
cd $GOPATH/src/github.com/wtfutil/wtf && \
|
||||
git checkout $version
|
||||
|
||||
ENV GOPROXY=https://proxy.golang.org,direct
|
||||
ENV GO111MODULE=on
|
||||
ENV GOSUMDB=off
|
||||
|
||||
WORKDIR $GOPATH/src/github.com/wtfutil/wtf
|
||||
|
||||
ENV PATH=$PATH:./bin
|
||||
|
||||
RUN make build && \
|
||||
cp bin/wtfutil /usr/local/bin/
|
463
Gopkg.lock
generated
Normal file
463
Gopkg.lock
generated
Normal file
@ -0,0 +1,463 @@
|
||||
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
|
||||
|
||||
|
||||
[[projects]]
|
||||
digest = "1:5ad08b0e14866764a6d7475eb11c9cf05cad9a52c442593bdfa544703ff77f61"
|
||||
name = "cloud.google.com/go"
|
||||
packages = ["compute/metadata"]
|
||||
pruneopts = "UT"
|
||||
revision = "0ebda48a7f143b1cce9eb37a8c1106ac762a3430"
|
||||
version = "v0.34.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:d1a104572273cfb58e801812704dca4fe2eab80f3b0144592a722a76c280c598"
|
||||
name = "code.cloudfoundry.org/bytefmt"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "2aa6f33b730c79971cfc3c742f279195b0abc627"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:e92f5581902c345eb4ceffdcd4a854fb8f73cf436d47d837d1ec98ef1fe0a214"
|
||||
name = "github.com/StackExchange/wmi"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "5d049714c4a64225c3c79a7cf7d02f7fb5b96338"
|
||||
version = "1.0.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:636ac9f696c988f0038afd43592f7a0fff29038588ab1064ba8ba3476bb41091"
|
||||
name = "github.com/adlio/trello"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "e4cc07c871d0ee17c5579131fc1c786efbb5fe2a"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:aa94227e54ee105fcd03f25c85d3e5bbe13d2f2d5eb02379b5b4db5320dfb371"
|
||||
name = "github.com/alecthomas/chroma"
|
||||
packages = [
|
||||
".",
|
||||
"formatters",
|
||||
"formatters/html",
|
||||
"lexers",
|
||||
"lexers/a",
|
||||
"lexers/b",
|
||||
"lexers/c",
|
||||
"lexers/circular",
|
||||
"lexers/d",
|
||||
"lexers/e",
|
||||
"lexers/f",
|
||||
"lexers/g",
|
||||
"lexers/h",
|
||||
"lexers/i",
|
||||
"lexers/internal",
|
||||
"lexers/j",
|
||||
"lexers/k",
|
||||
"lexers/l",
|
||||
"lexers/m",
|
||||
"lexers/n",
|
||||
"lexers/o",
|
||||
"lexers/p",
|
||||
"lexers/q",
|
||||
"lexers/r",
|
||||
"lexers/s",
|
||||
"lexers/t",
|
||||
"lexers/v",
|
||||
"lexers/w",
|
||||
"lexers/x",
|
||||
"lexers/y",
|
||||
"styles",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "881a441774f9d707d3b7852025b7f2149a556182"
|
||||
version = "v0.6.2"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:a7955b3402449f2e9ef351d0d6d9d42af3e0b24967340b738078d80c90deb6c2"
|
||||
name = "github.com/andygrunwald/go-gerrit"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "f48c3d16616fdb85d96efcead2402bfd339d8c89"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:6d7646b01dbbacd8c50be0cbddbcb633619f819e51f47a4114c8d4518ae7ac02"
|
||||
name = "github.com/briandowns/openweathermap"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "5f41b7c9d92de5d74bf32f4486375c7547bc8a3c"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:166438587ed45ac211dab8a3ecebf4fa0c186d0db63430fb9127bbc2e5fcdc67"
|
||||
name = "github.com/cenkalti/backoff"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "1e4cf3da559842a91afcb6ea6141451e6c30c618"
|
||||
version = "v2.1.1"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:710109527a119c813d4fac773712dd92f449ed7c2f7b81f49822f94d290c8f72"
|
||||
name = "github.com/danwakefield/fnmatch"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "cbb64ac3d964b81592e64f957ad53df015803288"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:e3e85f98942fe3b51b8f9316d8d1dc1925353b26639d456030368ae278bb0475"
|
||||
name = "github.com/darkSasori/todoist"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "ec6b38b374ab9c60cc9716d2083ae66eb9383d03"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec"
|
||||
name = "github.com/davecgh/go-spew"
|
||||
packages = ["spew"]
|
||||
pruneopts = "UT"
|
||||
revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73"
|
||||
version = "v1.1.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:72dc2b6056e7097f829260e4a2ff08d32fec6017df1982a66e110ab4128486f8"
|
||||
name = "github.com/dlclark/regexp2"
|
||||
packages = [
|
||||
".",
|
||||
"syntax",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "487489b64fb796de2e55f4e8a4ad1e145f80e957"
|
||||
version = "v1.1.6"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:6f9339c912bbdda81302633ad7e99a28dfa5a639c864061f1929510a9a64aa74"
|
||||
name = "github.com/dustin/go-humanize"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "9f541cc9db5d55bce703bd99987c9d5cb8eea45e"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:0e16b03c72bd42739ca68d055c10369e60d17838428f512f3b29ae115ba788e0"
|
||||
name = "github.com/gdamore/encoding"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "6289cdc94c00ac4aa177771c5fce7af2f96b626d"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:937011a37a09b93be68052dfb3195fcfbff33b9472b37401b54027e9954906fb"
|
||||
name = "github.com/gdamore/tcell"
|
||||
packages = [
|
||||
".",
|
||||
"terminfo",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "aaadc574a6ed8dc3abe56036ca130dcee1ee6b6e"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:c96d16a4451e48e2c44b2c3531fd8ec9248d822637f1911a88959ca0bcae4a64"
|
||||
name = "github.com/go-ole/go-ole"
|
||||
packages = [
|
||||
".",
|
||||
"oleutil",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "39dc8486bd0952279431257138bc428275b86797"
|
||||
version = "v1.2.2"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:b3d20bcdedab2050e6bc58e52f4fdc46f710b4c74e1a1ecee262ebec1aee7b6e"
|
||||
name = "github.com/godbus/dbus"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "2ff6f7ffd60f0f2410b3105864bdd12c7894f844"
|
||||
version = "v5.0.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:97df918963298c287643883209a2c3f642e6593379f97ab400c2a2e219ab647d"
|
||||
name = "github.com/golang/protobuf"
|
||||
packages = ["proto"]
|
||||
pruneopts = "UT"
|
||||
revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5"
|
||||
version = "v1.2.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:fc71ff099a9d9e73a66556c3115c78ca64cd7f01e08a7eddcaddcba5e8fa02fd"
|
||||
name = "github.com/google/go-github"
|
||||
packages = ["github"]
|
||||
pruneopts = "UT"
|
||||
revision = "ce65dacfeac482f2a13b59e19c5a25947282c171"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:a63cff6b5d8b95638bfe300385d93b2a6d9d687734b863da8e09dc834510a690"
|
||||
name = "github.com/google/go-querystring"
|
||||
packages = ["query"]
|
||||
pruneopts = "UT"
|
||||
revision = "44c6ddd0a2342c386950e880b658017258da92fc"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:a2cff208d4759f6ba1b1cd228587b0a1869f95f22542ec9cd17fff64430113c7"
|
||||
name = "github.com/jessevdk/go-flags"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "c6ca198ec95c841fdb89fc0de7496fed11ab854e"
|
||||
version = "v1.4.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:c65a16ac77d0b1aefc7009cabb6ac5ad05def02025f5be85f450c03f52cc6f86"
|
||||
name = "github.com/lucasb-eyer/go-colorful"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "345fbb3dbcdb252d9985ee899a84963c0fa24c82"
|
||||
version = "v1.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:0356f3312c9bd1cbeda81505b7fd437501d8e778ab66998ef69f00d7f9b3a0d7"
|
||||
name = "github.com/mattn/go-runewidth"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "3ee7d812e62a0804a7d0a324e0249ca2db3476d3"
|
||||
version = "v0.0.4"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:2277d06c9dcd34d70119b624115f3d74672647322349bb76a8adedbc623a3955"
|
||||
name = "github.com/olebedev/config"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "57f804269e64d41bfe46efb76232c47f49d40902"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:cf31692c14422fa27c83a05292eb5cbe0fb2775972e8f1f8446a71549bd8980b"
|
||||
name = "github.com/pkg/errors"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "ba968bfe8b2f7e042a574c888954fccecfa385b4"
|
||||
version = "v0.8.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:cfa0d7741863a0e1d30e0ccdd4b48a96a471cdb47892303de8b92c3713af3e77"
|
||||
name = "github.com/pkg/profile"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "5b67d428864e92711fcbd2f8629456121a56d91f"
|
||||
version = "v1.2.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe"
|
||||
name = "github.com/pmezard/go-difflib"
|
||||
packages = ["difflib"]
|
||||
pruneopts = "UT"
|
||||
revision = "792786c7400a136282c1664665ae0a8db921c6c2"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:46f5782e57d221d76a19fb9c9c4f2b139f1d85ae7115a95e945a79221e1a7031"
|
||||
name = "github.com/radovskyb/watcher"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "3818ec23ec59ea15084fe26bfb114b3bb58aa132"
|
||||
version = "v1.0.5"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:0f44ebd1757c5725456f2d6c564b196dd96593e68fda7236e345642940b9a88a"
|
||||
name = "github.com/rivo/tview"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "36893a66979260e9758701ae306ec0d69c0f53c8"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:afee7cbe8cde64304b8bd397d5832b0e60c93f8b158e4102254558d2f862b0a6"
|
||||
name = "github.com/shirou/gopsutil"
|
||||
packages = [
|
||||
"cpu",
|
||||
"internal/common",
|
||||
"mem",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "ccc1c1016bc5d10e803189ee43417c50cdde7f1b"
|
||||
version = "v2.18.12"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:93ff598337cb35c40079a1ba766729c20eb1756e37f5740eac4c8e943f59664d"
|
||||
name = "github.com/sticreations/spotigopher"
|
||||
packages = ["spotigopher"]
|
||||
pruneopts = "UT"
|
||||
revision = "98632f6f94b087f2582be76980f76bc070d37176"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:972c2427413d41a1e06ca4897e8528e5a1622894050e2f527b38ddf0f343f759"
|
||||
name = "github.com/stretchr/testify"
|
||||
packages = ["assert"]
|
||||
pruneopts = "UT"
|
||||
revision = "ffdc059bfe9ce6a4e144ba849dbedead332c6053"
|
||||
version = "v1.3.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:fc5ea767f62a8a35b136db9e8629dc7718aea555c8480e44695a7d0894ae8303"
|
||||
name = "github.com/xanzy/go-gitlab"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "d85a1530126065c71277db28196ec196daafc9dc"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:3b19ea715e070a74397f3cfe950f0b555e66a3c23461e553777f52112a81b0e6"
|
||||
name = "github.com/yfronto/newrelic"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "7c9c2852e8f9e69a80bff4f4f1fe4cdd15eeba19"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:1ff6915a45fb06d272e614e72219aa058aefc545f597a708eb0cc6cb778c344a"
|
||||
name = "github.com/zmb3/spotify"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "a4bd83f60e06ab58f3516c61680d0532aabf470e"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:0af28605549b0c849891b2ea4e99de9fe20d2f48d3ae5d42f9b06391e02a466e"
|
||||
name = "github.com/zorkian/go-datadog-api"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "66f4fd4202d9d3e543608051a91a09eebc870966"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:f8b491a7c25030a895a0e579742d07136e6958e77ef2d46e769db8eec4e58fcd"
|
||||
name = "golang.org/x/net"
|
||||
packages = [
|
||||
"context",
|
||||
"context/ctxhttp",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "915654e7eabcea33ae277abbecf52f0d8b7a9fdc"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:c58bbfb91df5a7eae08cb9894f9897165f254e459f07666986cd448f9be4ad35"
|
||||
name = "golang.org/x/oauth2"
|
||||
packages = [
|
||||
".",
|
||||
"google",
|
||||
"internal",
|
||||
"jws",
|
||||
"jwt",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "36a7019397c4c86cf59eeab3bc0d188bac444277"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:5ee4df7ab18e945607ac822de8d10b180baea263b5e8676a1041727543b9c1e4"
|
||||
name = "golang.org/x/sys"
|
||||
packages = [
|
||||
"unix",
|
||||
"windows",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "48ac38b7c8cbedd50b1613c0fccacfc7d88dfcdf"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:37672ad5821719e2df8509c2edd4ba5ae192463237c73c3a2d24ef8b2bc9e36f"
|
||||
name = "golang.org/x/text"
|
||||
packages = [
|
||||
"encoding",
|
||||
"encoding/internal/identifier",
|
||||
"internal/gen",
|
||||
"transform",
|
||||
"unicode/cldr",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0"
|
||||
version = "v0.3.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:4b5fd36b449e451b5b4a4e8b31870c9230647f409413f13169ab93af268311da"
|
||||
name = "google.golang.org/api"
|
||||
packages = [
|
||||
"calendar/v3",
|
||||
"gensupport",
|
||||
"googleapi",
|
||||
"googleapi/internal/uritemplates",
|
||||
"sheets/v4",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "455dee39f703f70d67ceea7c56a61041712c1447"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:fa026a5c59bd2df343ec4a3538e6288dcf4e2ec5281d743ae82c120affe6926a"
|
||||
name = "google.golang.org/appengine"
|
||||
packages = [
|
||||
".",
|
||||
"internal",
|
||||
"internal/app_identity",
|
||||
"internal/base",
|
||||
"internal/datastore",
|
||||
"internal/log",
|
||||
"internal/modules",
|
||||
"internal/remote_api",
|
||||
"internal/urlfetch",
|
||||
"urlfetch",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "e9657d882bb81064595ca3b56cbe2546bbabf7b1"
|
||||
version = "v1.4.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96"
|
||||
name = "gopkg.in/yaml.v2"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "51d6538a90f86fe93ac480b35f37b2be17fef232"
|
||||
version = "v2.2.2"
|
||||
|
||||
[solve-meta]
|
||||
analyzer-name = "dep"
|
||||
analyzer-version = 1
|
||||
input-imports = [
|
||||
"code.cloudfoundry.org/bytefmt",
|
||||
"github.com/adlio/trello",
|
||||
"github.com/alecthomas/chroma/formatters",
|
||||
"github.com/alecthomas/chroma/lexers",
|
||||
"github.com/alecthomas/chroma/styles",
|
||||
"github.com/andygrunwald/go-gerrit",
|
||||
"github.com/briandowns/openweathermap",
|
||||
"github.com/darkSasori/todoist",
|
||||
"github.com/dustin/go-humanize",
|
||||
"github.com/gdamore/tcell",
|
||||
"github.com/google/go-github/github",
|
||||
"github.com/jessevdk/go-flags",
|
||||
"github.com/olebedev/config",
|
||||
"github.com/pkg/profile",
|
||||
"github.com/radovskyb/watcher",
|
||||
"github.com/rivo/tview",
|
||||
"github.com/shirou/gopsutil/cpu",
|
||||
"github.com/shirou/gopsutil/mem",
|
||||
"github.com/sticreations/spotigopher/spotigopher",
|
||||
"github.com/stretchr/testify/assert",
|
||||
"github.com/xanzy/go-gitlab",
|
||||
"github.com/yfronto/newrelic",
|
||||
"github.com/zmb3/spotify",
|
||||
"github.com/zorkian/go-datadog-api",
|
||||
"golang.org/x/oauth2",
|
||||
"golang.org/x/oauth2/google",
|
||||
"google.golang.org/api/calendar/v3",
|
||||
"google.golang.org/api/sheets/v4",
|
||||
"gopkg.in/yaml.v2",
|
||||
]
|
||||
solver-name = "gps-cdcl"
|
||||
solver-version = 1
|
107
Gopkg.toml
Normal file
107
Gopkg.toml
Normal file
@ -0,0 +1,107 @@
|
||||
# Gopkg.toml example
|
||||
#
|
||||
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
|
||||
# for detailed Gopkg.toml documentation.
|
||||
#
|
||||
# required = ["github.com/user/thing/cmd/thing"]
|
||||
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
|
||||
#
|
||||
# [[constraint]]
|
||||
# name = "github.com/user/project"
|
||||
# version = "1.0.0"
|
||||
#
|
||||
# [[constraint]]
|
||||
# name = "github.com/user/project2"
|
||||
# branch = "dev"
|
||||
# source = "github.com/myfork/project2"
|
||||
#
|
||||
# [[override]]
|
||||
# name = "github.com/x/y"
|
||||
# version = "2.4.0"
|
||||
#
|
||||
# [prune]
|
||||
# non-go = false
|
||||
# go-tests = true
|
||||
# unused-packages = true
|
||||
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/briandowns/openweathermap"
|
||||
branch = "master"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/gdamore/tcell"
|
||||
branch = "master"
|
||||
|
||||
#[[constraint]]
|
||||
#name = "github.com/go-test/deep"
|
||||
#version = "1.0.1"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/google/go-github"
|
||||
branch = "master"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/xanzy/go-gitlab"
|
||||
branch = "master"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/andygrunwald/go-gerrit"
|
||||
branch = "master"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/jessevdk/go-flags"
|
||||
version = "1.4.0"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/olebedev/config"
|
||||
branch = "master"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/radovskyb/watcher"
|
||||
version = "1.0.2"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/rivo/tview"
|
||||
branch = "master"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/yfronto/newrelic"
|
||||
branch = "master"
|
||||
|
||||
[[constraint]]
|
||||
name = "golang.org/x/oauth2"
|
||||
branch = "master"
|
||||
|
||||
[[constraint]]
|
||||
name = "google.golang.org/api"
|
||||
branch = "master"
|
||||
|
||||
[[constraint]]
|
||||
name = "gopkg.in/yaml.v2"
|
||||
version = "2.2.1"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/adlio/trello"
|
||||
branch = "master"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/darkSasori/todoist"
|
||||
branch = "master"
|
||||
|
||||
[prune]
|
||||
go-tests = true
|
||||
unused-packages = true
|
||||
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/zorkian/go-datadog-api"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "code.cloudfoundry.org/bytefmt"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/shirou/gopsutil"
|
||||
version = "2.18.10"
|
54
LICENSE.md
54
LICENSE.md
@ -1,8 +1,6 @@
|
||||
*Mozilla Public License, version 2.0*
|
||||
Copyright 2018, Chris Cummer
|
||||
|
||||
1. Definitions
|
||||
|
||||
1.1. “Contributor” means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software.
|
||||
Mozilla Public License, version 2.0 1. Definitions 1.1. “Contributor” means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software.
|
||||
|
||||
1.2. “Contributor Version” means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution.
|
||||
|
||||
@ -26,9 +24,9 @@ that the Covered Software was made available under the terms of version 1.1 or e
|
||||
|
||||
1.10. “Modifications” means any of the following:
|
||||
|
||||
any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or
|
||||
any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or
|
||||
|
||||
any new file in Source Code Form that contains any Covered Software.
|
||||
any new file in Source Code Form that contains any Covered Software.
|
||||
|
||||
1.11. “Patent Claims” of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version.
|
||||
|
||||
@ -38,9 +36,7 @@ that the Covered Software was made available under the terms of version 1.1 or e
|
||||
|
||||
1.14. “You” (or “Your”) means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
|
||||
|
||||
2. License Grants and Conditions
|
||||
|
||||
2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
|
||||
2. License Grants and Conditions 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
|
||||
|
||||
under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and
|
||||
|
||||
@ -66,9 +62,7 @@ This License does not grant any rights in the trademarks, service marks, or logo
|
||||
|
||||
2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1.
|
||||
|
||||
3. Responsibilities
|
||||
|
||||
3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form.
|
||||
3. Responsibilities 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form.
|
||||
|
||||
3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then:
|
||||
|
||||
@ -82,37 +76,23 @@ You may distribute such Executable Form under the terms of this License, or subl
|
||||
|
||||
3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
4. Inability to Comply Due to Statute or Regulation If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Termination
|
||||
|
||||
5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice.
|
||||
5. Termination 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice.
|
||||
|
||||
5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate.
|
||||
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination.
|
||||
|
||||
6. Disclaimer of Warranty
|
||||
6. Disclaimer of Warranty Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer.
|
||||
|
||||
Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer.
|
||||
7. Limitation of Liability Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.
|
||||
|
||||
7. Limitation of Liability
|
||||
8. Litigation Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims.
|
||||
|
||||
Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.
|
||||
9. Miscellaneous This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor.
|
||||
|
||||
8. Litigation
|
||||
|
||||
Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims.
|
||||
|
||||
9. Miscellaneous
|
||||
|
||||
This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor.
|
||||
|
||||
10. Versions of the License
|
||||
|
||||
10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number.
|
||||
10. Versions of the License 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number.
|
||||
|
||||
10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward.
|
||||
|
||||
@ -120,14 +100,10 @@ This License represents the complete agreement concerning the subject matter her
|
||||
|
||||
10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached.
|
||||
|
||||
Exhibit A - Source Code Form License Notice
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
Exhibit A - Source Code Form License Notice This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.
|
||||
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
|
||||
Exhibit B - “Incompatible With Secondary Licenses” Notice
|
||||
|
||||
This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0.
|
||||
Exhibit B - “Incompatible With Secondary Licenses” Notice This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0.
|
||||
|
171
Makefile
171
Makefile
@ -1,164 +1,41 @@
|
||||
.PHONY: build clean contrib_check coverage docker-build docker-install help install isntall lint run size test uninstall
|
||||
.PHONY: contrib_check dependencies install run size test
|
||||
|
||||
# detect GOPATH if not set
|
||||
ifndef $(GOPATH)
|
||||
$(info GOPATH is not set, autodetecting..)
|
||||
TESTPATH := $(dir $(abspath ../../..))
|
||||
DIRS := bin pkg src
|
||||
|
||||
# create a ; separated line of tests and pass it to shell
|
||||
MISSING_DIRS := $(shell $(foreach entry,$(DIRS),test -d "$(TESTPATH)$(entry)" || echo "$(entry)";))
|
||||
ifeq ($(MISSING_DIRS),)
|
||||
$(info Found GOPATH: $(TESTPATH))
|
||||
export GOPATH := $(TESTPATH)
|
||||
else
|
||||
$(info ..missing dirs "$(MISSING_DIRS)" in "$(TESTDIR)")
|
||||
$(info GOPATH autodetection failed)
|
||||
endif
|
||||
$(info GOPATH is not set, autodetecting..)
|
||||
TESTPATH := $(dir $(abspath ../../..))
|
||||
DIRS := bin pkg src
|
||||
# create a ; separated line of tests and pass it to shell
|
||||
MISSING_DIRS := $(shell $(foreach entry,$(DIRS),test -d "$(TESTPATH)$(entry)" || echo "$(entry)";))
|
||||
ifeq ($(MISSING_DIRS),)
|
||||
$(info Found GOPATH: $(TESTPATH))
|
||||
export GOPATH := $(TESTPATH)
|
||||
else
|
||||
$(info ..missing dirs "$(MISSING_DIRS)" in "$(TESTDIR)")
|
||||
$(info GOPATH autodetection failed)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Set go modules to on and use GoCenter for immutable modules
|
||||
export GO111MODULE = on
|
||||
export GOPROXY = https://proxy.golang.org,direct
|
||||
|
||||
# Determines the path to this Makefile
|
||||
THIS_FILE := $(lastword $(MAKEFILE_LIST))
|
||||
|
||||
APP=wtfutil
|
||||
|
||||
define HEADER
|
||||
____ __ ____ .___________. _______
|
||||
\ \ / \ / / | || ____|
|
||||
\ \/ \/ / `---| |----`| |__
|
||||
\ / | | | __|
|
||||
\ /\ / | | | |
|
||||
\__/ \__/ |__| |__|
|
||||
|
||||
endef
|
||||
export HEADER
|
||||
|
||||
# -------------------- Actions -------------------- #
|
||||
|
||||
## build: builds a local version
|
||||
build:
|
||||
@echo "$$HEADER"
|
||||
@echo "Building..."
|
||||
go build -o bin/${APP}
|
||||
@echo "Done building"
|
||||
go build -o bin/wtf
|
||||
|
||||
## clean: removes old build cruft
|
||||
clean:
|
||||
rm -rf ./dist
|
||||
rm -rf ./bin/${APP}
|
||||
@echo "Done cleaning"
|
||||
|
||||
## contrib-check: checks for any contributors who have not been given due credit
|
||||
contrib-check:
|
||||
contrib_check:
|
||||
npx all-contributors-cli check
|
||||
|
||||
## coverage: figures out and displays test code coverage
|
||||
coverage:
|
||||
go test -coverprofile=coverage.out ./...
|
||||
go tool cover -html=coverage.out
|
||||
|
||||
## docker-build: builds in docker
|
||||
docker-build:
|
||||
@echo "Building ${APP} in Docker..."
|
||||
docker build -t wtfutil:build --build-arg=version=master -f Dockerfile.build .
|
||||
@echo "Done with docker build"
|
||||
|
||||
## docker-install: installs a local version of the app from docker build
|
||||
docker-install:
|
||||
@echo "Installing..."
|
||||
docker create --name wtf_build wtfutil:build
|
||||
docker cp wtf_build:/usr/local/bin/wtfutil ~/.local/bin/
|
||||
$(eval INSTALLPATH = $(shell which ${APP}))
|
||||
@echo "${APP} installed into ${INSTALLPATH}"
|
||||
docker rm wtf_build
|
||||
|
||||
## gosec: runs the gosec static security scanner against the source code
|
||||
gosec:
|
||||
gosec -tests ./...
|
||||
|
||||
## help: prints this help message
|
||||
help:
|
||||
@echo "Usage: \n"
|
||||
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
|
||||
|
||||
## isntall: an alias for 'install'
|
||||
isntall:
|
||||
@$(MAKE) -f $(THIS_FILE) install
|
||||
|
||||
## install: installs a local version of the app
|
||||
install:
|
||||
$(eval GOVERS = $(shell go version))
|
||||
@echo "$$HEADER"
|
||||
@echo "Installing ${APP} with ${GOVERS}..."
|
||||
@go clean
|
||||
@go install -ldflags="-s -w -X main.version=$(shell git describe --always --abbrev=6) -X main.date=$(shell date +%FT%T%z)"
|
||||
@mv ~/go/bin/wtf ~/go/bin/${APP}
|
||||
$(eval INSTALLPATH = $(shell which ${APP}))
|
||||
@echo "${APP} installed into ${INSTALLPATH}"
|
||||
go clean
|
||||
go install -ldflags="-s -w -X main.version=$(shell git describe --always --abbrev=6) -X main.date=$(shell date +%FT%T%z)"
|
||||
which wtf
|
||||
|
||||
## lint: runs a number of code quality checks against the source code
|
||||
lint:
|
||||
golangci-lint cache clean
|
||||
golangci-lint run
|
||||
structcheck ./...
|
||||
varcheck ./...
|
||||
|
||||
# lint:
|
||||
# @echo "\033[35mhttps://github.com/kisielk/errcheck\033[0m"
|
||||
# errcheck ./app
|
||||
# errcheck ./cfg
|
||||
# errcheck ./flags
|
||||
# errcheck ./help
|
||||
# errcheck ./logger
|
||||
# errcheck ./modules/...
|
||||
# errcheck ./utils
|
||||
# errcheck ./view
|
||||
# errcheck ./wtf
|
||||
# errcheck ./main.go
|
||||
|
||||
# @echo "\033[35mhttps://golang.org/cmd/vet/k\033[0m"
|
||||
# go vet ./app
|
||||
# go vet ./cfg
|
||||
# go vet ./flags
|
||||
# go vet ./help
|
||||
# go vet ./logger
|
||||
# go vet ./modules/...
|
||||
# go vet ./utils
|
||||
# go vet ./view
|
||||
# go vet ./wtf
|
||||
# go vet ./main.go
|
||||
|
||||
# @echo "\033[35m# https://staticcheck.io/docs/k\033[0m"
|
||||
# staticcheck ./app
|
||||
# staticcheck ./cfg
|
||||
# staticcheck ./flags
|
||||
# staticcheck ./help
|
||||
# staticcheck ./logger
|
||||
# staticcheck ./modules/...
|
||||
# staticcheck ./utils
|
||||
# staticcheck ./view
|
||||
# staticcheck ./wtf
|
||||
# staticcheck ./main.go
|
||||
|
||||
# @echo "\033[35m# https://github.com/mdempsky/unconvert\033[0m"
|
||||
# unconvert ./...
|
||||
|
||||
## loc: displays the lines of code (LoC) count
|
||||
loc:
|
||||
@loc --exclude _sample_configs/ _site/ docs/ Makefile *.md
|
||||
|
||||
## run: executes the locally-installed version
|
||||
run: build
|
||||
@echo "$$HEADER"
|
||||
bin/${APP}
|
||||
bin/wtf
|
||||
|
||||
size:
|
||||
loc --exclude vendor/ _sample_configs/ _site/ docs/ Makefile *.md *.toml
|
||||
|
||||
## test: runs the test suite
|
||||
test: build
|
||||
@echo "$$HEADER"
|
||||
go test ./...
|
||||
|
||||
## uninstall: uninstals a locally-installed version
|
||||
uninstall:
|
||||
@rm ~/go/bin/${APP}
|
||||
|
437
README.md
437
README.md
@ -1,435 +1,75 @@
|
||||
<p align="center">
|
||||
<img src="./images/logo_transparent.png?raw=true" title="WTF" alt="WTF" width="560" height="560" />
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="#contributors"><img alt="All Contributors" src="https://img.shields.io/badge/all_contributors-114-orange.svg?style=flat-square"></a>
|
||||
<a href="https://travis-ci.com/wtfutil/wtf"><img alt="Travis Status" src="https://img.shields.io/travis/com/wtfutil/wtf/master.svg?label=travis&maxAge=43200"></a>
|
||||
<a href="https://goreportcard.com/report/github.com/wtfutil/wtf"><img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/wtfutil/wtf"></a>
|
||||
<a href="https://twitter.com/wtfutil"><img alt="Twitter" src="https://img.shields.io/badge/follow-on%20twitter-blue.svg"></a>
|
||||
</p>
|
||||
[](#contributors)
|
||||
[](#contributors)
|
||||
[](https://travis-ci.com/wtfutil/wtf)
|
||||
[](https://gitter.im/wtfutil/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://twitter.com/wtfutil)
|
||||
[](https://goreportcard.com/report/github.com/wtfutil/wtf)
|
||||
|
||||
WTF (aka 'wtfutil') is the personal information dashboard for your terminal, providing at-a-glance access to your very important but infrequently-needed stats and data.
|
||||
# WTF
|
||||
|
||||
Used by thousands of developers and tech people around the world, WTF is free and open-source. To support the continued use and development of WTF, please consider sponsoring WTF via [GitHub Sponsors](https://github.com/sponsors/senorprogrammer).
|
||||
A personal terminal-based dashboard utility, designed for
|
||||
displaying infrequently-needed, but very important, daily data.
|
||||
|
||||
### Are you a contributor or sponsor?
|
||||
|
||||
Awesome! [See here](https://wtfutil.com/#exit-message) for how you can change the exit message, the message WTF shows when quitting, to something special just for you.
|
||||
|
||||
#
|
||||
|
||||
<p></p>
|
||||
|
||||
* [Installation](#installation)
|
||||
* [Installing via Homebrew](#installing-via-homebrew)
|
||||
* [Installing via MacPorts](#installing-via-macports)
|
||||
* [Installing a Binary](#installing-a-binary)
|
||||
* [Installing from Source](#installing-from-source)
|
||||
* [Running via Docker](#running-via-docker)
|
||||
* [Communication](#communication)
|
||||
* [Slack](#slack)
|
||||
* [Twitter](#twitter)
|
||||
* [Documentation](#documentation)
|
||||
* [Modules](#modules)
|
||||
* [Getting Bugs Fixed or Features Added](#getting-bugs-fixed-or-features-added)
|
||||
* [Contributing to the Source Code](#contributing-to-the-source-code)
|
||||
* [Adding Dependencies](#adding-dependencies)
|
||||
* [Contributing to the Documentation](#contributing-to-the-documentation)
|
||||
* [Contributors](#contributors)
|
||||
* [Acknowledgements](#acknowledgments)
|
||||
Follow [on Twitter](https://twitter.com/wtfutil) for news and latest updates.
|
||||
|
||||
<p align="center">
|
||||
<img src="./images/screenshot.jpg" title="screenshot" width="720" height="420" />
|
||||
</p>
|
||||
|
||||
## Installation
|
||||
## Quick Start
|
||||
|
||||
### Installing via Homebrew
|
||||
|
||||
The simplest way from Homebrew:
|
||||
|
||||
```console
|
||||
brew install wtfutil
|
||||
|
||||
wtfutil
|
||||
```
|
||||
|
||||
That version can sometimes lag a bit, as recipe updates take time to get accepted into `homebrew-core`. If you always want the bleeding edge of releases, you can tap it:
|
||||
|
||||
```console
|
||||
brew tap wtfutil/wtfutil
|
||||
brew install wtfutil
|
||||
|
||||
wtfutil
|
||||
```
|
||||
|
||||
### Installing via MacPorts
|
||||
|
||||
You can also install via [MacPorts](https://www.macports.org/):
|
||||
|
||||
```console
|
||||
sudo port selfupdate
|
||||
sudo port install wtfutil
|
||||
|
||||
wtfutil
|
||||
```
|
||||
|
||||
### Installing a Binary
|
||||
|
||||
[Download the latest binary](https://github.com/wtfutil/wtf/releases) from GitHub.
|
||||
|
||||
WTF is a stand-alone binary. Once downloaded, copy it to a location you can run executables from (ie: `/usr/local/bin/`), and set the permissions accordingly:
|
||||
[Download and run the latest binary](https://github.com/wtfutil/wtf/releases) or install from source:
|
||||
|
||||
```bash
|
||||
chmod a+x /usr/local/bin/wtfutil
|
||||
```
|
||||
|
||||
and you should be good to go.
|
||||
|
||||
### Installing from Source
|
||||
|
||||
If you want to run the build command from within your `$GOPATH`:
|
||||
|
||||
```bash
|
||||
# Set the Go proxy
|
||||
export GOPROXY="https://proxy.golang.org,direct"
|
||||
|
||||
# Disable the Go checksum database
|
||||
export GOSUMDB=off
|
||||
|
||||
# Enable Go modules
|
||||
export GO111MODULE=on
|
||||
|
||||
go get -u github.com/wtfutil/wtf
|
||||
cd $GOPATH/src/github.com/wtfutil/wtf
|
||||
make install
|
||||
make run
|
||||
```
|
||||
|
||||
If you want to run the build command from a folder that is not in your `$GOPATH`:
|
||||
|
||||
```bash
|
||||
# Set the Go proxy
|
||||
export GOPROXY="https://proxy.golang.org,direct"
|
||||
|
||||
go get -u github.com/wtfutil/wtf
|
||||
cd $GOPATH/src/github.com/wtfutil/wtf
|
||||
make install
|
||||
make run
|
||||
```
|
||||
|
||||
### Installing from Source using Docker
|
||||
|
||||
All building is done inside a docker container. You can then copy the binary to
|
||||
your local machine.
|
||||
|
||||
```bash
|
||||
curl -o Dockerfile.build https://raw.githubusercontent.com/wtfutil/wtf/master/Dockerfile.build
|
||||
docker build -f Dockerfile.build -t wtfutil --build-arg=version=master .
|
||||
docker create --name wtf_build wtfutil
|
||||
docker cp wtf_build:/usr/local/bin/wtfutil ~/.local/bin
|
||||
docker rm wtf_build
|
||||
```
|
||||
|
||||
**Note:** WTF is _only_ compatible with Go versions **1.16.0** or later (due to the use of Go modules and newer standard library functions). If you would like to use `gccgo` to compile, you _must_ use `gccgo-9` or later which introduces support for Go modules.
|
||||
|
||||
### Installing via Arch User Repository
|
||||
|
||||
Arch Linux users can utilise the [wtfutil](https://aur.archlinux.org/packages/wtfutil) package to build it from source, or [wtfutil-bin](https://aur.archlinux.org/packages/wtfutil-bin/) to install pre-built binaries.
|
||||
|
||||
## Running via Docker
|
||||
|
||||
You can run `wtf` inside a docker container:
|
||||
|
||||
```bash
|
||||
# download or create the Dockerfile
|
||||
curl -o Dockerfile https://raw.githubusercontent.com/wtfutil/wtf/master/Dockerfile
|
||||
|
||||
# build the docker container
|
||||
docker build -t wtfutil .
|
||||
|
||||
# or for a particular tag or branch
|
||||
docker build --build-arg=version=v0.25.0 -t wtfutil .
|
||||
|
||||
# run the container
|
||||
docker run -it wtfutil
|
||||
|
||||
# run container with a local config file
|
||||
docker run -it -v path/to/config.yml:/config/config.yml wtfutil --config=/config/config.yml
|
||||
```
|
||||
|
||||
## Communication
|
||||
|
||||
### Slack
|
||||
|
||||
If you’re a member of the Gophers Slack community (https://invite.slack.golangbridge.org) there’s a WTFUtil channel you should join for all your WTF questions, development conversations, etc.
|
||||
|
||||
Find #wtfutil on https://gophers.slack.com/ and join us.
|
||||
|
||||
### Twitter
|
||||
|
||||
Also, follow [on Twitter](https://twitter.com/wtfutil) for news and latest updates.
|
||||
**Note:** WTF is _only_ compatible with Go versions **1.9.2** or later. It currently _does not_ compile with `gccgo`.
|
||||
|
||||
## Documentation
|
||||
|
||||
See [https://wtfutil.com](https://wtfutil.com) for the definitive
|
||||
documentation. Here's some short-cuts:
|
||||
|
||||
* [Installation](https://wtfutil.com/quick_start/)
|
||||
* [Configuration](https://wtfutil.com/configuration/files/)
|
||||
* [Module Documentation](https://wtfutil.com/modules/)
|
||||
* [Installation](http://wtfutil.com/posts/installation/)
|
||||
* [Configuration](http://wtfutil.com/posts/configuration/)
|
||||
* [Module Documentation](http://wtfutil.com/posts/modules/)
|
||||
|
||||
## Modules
|
||||
### Contributing to the Documentation
|
||||
|
||||
Modules are the chunks of functionality that make WTF useful. Modules are added and configured by including their configuration values in your `config.yml` file. The documentation for each module describes how to configure them.
|
||||
|
||||
Some interesting modules you might consider adding to get you started:
|
||||
|
||||
* [DigitalOcean](https://wtfutil.com/modules/digitalocean/)
|
||||
* [GitHub](https://wtfutil.com/modules/github/)
|
||||
* [Google Calendar](https://wtfutil.com/modules/google/gcal/)
|
||||
* [HackerNews](https://wtfutil.com/modules/hackernews/)
|
||||
* [Have I Been Pwned](https://wtfutil.com/modules/hibp/)
|
||||
* [NewRelic](https://wtfutil.com/modules/newrelic/)
|
||||
* [OpsGenie](https://wtfutil.com/modules/opsgenie/)
|
||||
* [Security](https://wtfutil.com/modules/security/)
|
||||
* [Transmission](https://wtfutil.com/modules/transmission/)
|
||||
* [Trello](https://wtfutil.com/modules/trello/)
|
||||
|
||||
## Getting Bugs Fixed or Features Added
|
||||
|
||||
WTF is open-source software, informally maintained by a small collection of volunteers who come and go at their leisure. There are absolutely no guarantees that, even if an issue is opened for them, bugs will be fixed or features added.
|
||||
|
||||
If there is a bug that you really need to have fixed or a feature you really want to have implemented, you can greatly increase your chances of that happening by creating a bounty on [BountySource](https://www.bountysource.com) to provide an incentive for someone to tackle it.
|
||||
|
||||
## Contributing to the Source Code
|
||||
|
||||
First, kindly read [Talk, then code](https://dave.cheney.net/2019/02/18/talk-then-code) by Dave Cheney. It's great advice and will often save a lot of time and effort.
|
||||
|
||||
Next, kindly read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests.
|
||||
|
||||
Then create your branch, write your code, submit your PR, and join the rest of the awesome people who've contributed their time and effort towards WTF. Without their contributors, WTF wouldn't be possible.
|
||||
|
||||
Don't worry if you've never written Go before, or never contributed to an open source project before, or that your code won't be good enough. For a surprising number of people WTF has been their first Go project, or first open source contribution. If you're here, and you've read this far, you're the right stuff.
|
||||
|
||||
## Contributing to the Documentation
|
||||
|
||||
Documentation now lives in its own repository here: [https://github.com/wtfutil/wtfdocs](https://github.com/wtfutil/wtfdocs).
|
||||
Documenation now lives in its own repository here: [https://github.com/wtfutil/wtfdocs](https://github.com/wtfutil/wtfdocs).
|
||||
|
||||
Please make all additions and updates to documentation in that repository.
|
||||
|
||||
## Contributing to the Source Code
|
||||
|
||||
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests.
|
||||
|
||||
### Adding Dependencies
|
||||
|
||||
Dependency management in WTF is handled by [Go modules](https://github.com/golang/go/wiki/Modules). Please check out that page for more details on how Go modules work.
|
||||
Dependency management in WTF is handled by [dep](https://github.com/golang/dep). See that page for installation and usage details.
|
||||
|
||||
If the work you're doing requires the addition of a new dependency,
|
||||
please be sure to use `dep` to [vendor your dependencies](https://golang.github.io/dep/docs/daily-dep.html#adding-a-new-dependency).
|
||||
|
||||
## Contributors
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center"><a href="https://twitter.com/senorprogrammer"><img src="https://avatars0.githubusercontent.com/u/6413?v=4" width="48px;" alt=""/><br /><sub><b>Chris Cummer</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/anandsudhir"><img src="https://avatars2.githubusercontent.com/u/3252403?v=4" width="48px;" alt=""/><br /><sub><b>Anand Sudhir Prayaga</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/jeangovil"><img src="https://avatars1.githubusercontent.com/u/34973359?v=4" width="48px;" alt=""/><br /><sub><b>Hossein Mehrabi</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/Fengyalv"><img src="https://avatars0.githubusercontent.com/u/11779018?v=4" width="48px;" alt=""/><br /><sub><b>FengYa</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://fluxionnetwork.github.io/fluxion/"><img src="https://avatars2.githubusercontent.com/u/17337753?v=4" width="48px;" alt=""/><br /><sub><b>deltax</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/BillKeenan"><img src="https://avatars0.githubusercontent.com/u/1319630?v=4" width="48px;" alt=""/><br /><sub><b>Bill Keenan</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://blog.sapara.com"><img src="https://avatars2.githubusercontent.com/u/118081?v=4" width="48px;" alt=""/><br /><sub><b>June S</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/XanthusL"><img src="https://avatars3.githubusercontent.com/u/16461061?v=4" width="48px;" alt=""/><br /><sub><b>liyiheng</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/baustinanki"><img src="https://avatars2.githubusercontent.com/u/9014288?v=4" width="48px;" alt=""/><br /><sub><b>baustinanki</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/lixin9311"><img src="https://avatars0.githubusercontent.com/u/371475?v=4" width="48px;" alt=""/><br /><sub><b>lucus lee</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/mxplusb"><img src="https://avatars1.githubusercontent.com/u/7537841?v=4" width="48px;" alt=""/><br /><sub><b>Mike Lloyd</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://rubiojr.rbel.co"><img src="https://avatars3.githubusercontent.com/u/10998?v=4" width="48px;" alt=""/><br /><sub><b>Sergio Rubio</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/FarhadF"><img src="https://avatars3.githubusercontent.com/u/17374492?v=4" width="48px;" alt=""/><br /><sub><b>Farhad Farahi</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://lasantha.blogspot.com/"><img src="https://avatars1.githubusercontent.com/u/634604?v=4" width="48px;" alt=""/><br /><sub><b>Lasantha Kularatne</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/dlom"><img src="https://avatars1.githubusercontent.com/u/823331?v=4" width="48px;" alt=""/><br /><sub><b>Mark Old</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://flw.tools/"><img src="https://avatars0.githubusercontent.com/u/5546718?v=4" width="48px;" alt=""/><br /><sub><b>flw</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/davebarda"><img src="https://avatars0.githubusercontent.com/u/6024927?v=4" width="48px;" alt=""/><br /><sub><b>David Barda</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/matrinox"><img src="https://avatars2.githubusercontent.com/u/4261980?v=4" width="48px;" alt=""/><br /><sub><b>Geoff Lee</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://international.github.io"><img src="https://avatars3.githubusercontent.com/u/1022918?v=4" width="48px;" alt=""/><br /><sub><b>George Opritescu</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://twitter.com/Grazfather"><img src="https://avatars3.githubusercontent.com/u/497310?v=4" width="48px;" alt=""/><br /><sub><b>Grazfather</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://www.mikecordell.com/"><img src="https://avatars2.githubusercontent.com/u/1691120?v=4" width="48px;" alt=""/><br /><sub><b>Michael Cordell</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="http://patrick.ibexcps.com"><img src="https://avatars2.githubusercontent.com/u/1215497?v=4" width="48px;" alt=""/><br /><sub><b>Patrick José Pereira</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/sherodtaylor"><img src="https://avatars2.githubusercontent.com/u/1483092?v=4" width="48px;" alt=""/><br /><sub><b>sherod taylor</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://cogentia.io"><img src="https://avatars2.githubusercontent.com/u/3062663?v=4" width="48px;" alt=""/><br /><sub><b>Andrew Scott</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/lsipii"><img src="https://avatars1.githubusercontent.com/u/12018440?v=4" width="48px;" alt=""/><br /><sub><b>Lassi Piironen</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/BlackWebWolf"><img src="https://avatars0.githubusercontent.com/u/14799210?v=4" width="48px;" alt=""/><br /><sub><b>BlackWebWolf</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/andrewzolotukhin"><img src="https://avatars0.githubusercontent.com/u/1894885?v=4" width="48px;" alt=""/><br /><sub><b>andrewzolotukhin</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://retgits.github.io"><img src="https://avatars1.githubusercontent.com/u/8568280?v=4" width="48px;" alt=""/><br /><sub><b>Leon Stigter</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://tamimi.se"><img src="https://avatars3.githubusercontent.com/u/21756?v=4" width="48px;" alt=""/><br /><sub><b>Amr Tamimi</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://jagdeep.me"><img src="https://avatars3.githubusercontent.com/u/3717137?v=4" width="48px;" alt=""/><br /><sub><b>Jagdeep Singh</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/darkSasori"><img src="https://avatars0.githubusercontent.com/u/889171?v=4" width="48px;" alt=""/><br /><sub><b>Lineu Felipe</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/kvj"><img src="https://avatars2.githubusercontent.com/u/159124?v=4" width="48px;" alt=""/><br /><sub><b>Konstantin</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://www.brendanoleary.com"><img src="https://avatars2.githubusercontent.com/u/6044920?v=4" width="48px;" alt=""/><br /><sub><b>Brendan O'Leary</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/bertl4398"><img src="https://avatars2.githubusercontent.com/u/1226441?v=4" width="48px;" alt=""/><br /><sub><b>bertl4398</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/Ferenc-"><img src="https://avatars2.githubusercontent.com/u/6553695?v=4" width="48px;" alt=""/><br /><sub><b>Ferenc-</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="http://rohanverma.net"><img src="https://avatars1.githubusercontent.com/u/952036?v=4" width="48px;" alt=""/><br /><sub><b>Rohan Verma</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/fimtitzgerald"><img src="https://avatars1.githubusercontent.com/u/19293566?v=4" width="48px;" alt=""/><br /><sub><b>Tim Fitzgerald</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/ruggi"><img src="https://avatars2.githubusercontent.com/u/1081051?v=4" width="48px;" alt=""/><br /><sub><b>Federico Ruggi</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/ctwoodward"><img src="https://avatars2.githubusercontent.com/u/7293328?v=4" width="48px;" alt=""/><br /><sub><b>Craig Woodward</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://twitter.com/ReadmeCritic"><img src="https://avatars3.githubusercontent.com/u/15367484?v=4" width="48px;" alt=""/><br /><sub><b>ReadmeCritic</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/jdevelop"><img src="https://avatars0.githubusercontent.com/u/141402?v=4" width="48px;" alt=""/><br /><sub><b>Eugene</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/Trinergy"><img src="https://avatars1.githubusercontent.com/u/12983705?s=460&v=4" width="48px;" alt=""/><br /><sub><b>Kenny Wu</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="http://www.romeroruiz.com"><img src="https://avatars0.githubusercontent.com/u/538234?v=4" width="48px;" alt=""/><br /><sub><b>Renán Romero</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/sticreations"><img src="https://avatars1.githubusercontent.com/u/5031240?v=4" width="48px;" alt=""/><br /><sub><b>Bastian Groß</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/nicholas-eden"><img src="https://avatars1.githubusercontent.com/u/2496835?v=4" width="48px;" alt=""/><br /><sub><b>nicholas-eden</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/danrabinowitz"><img src="https://avatars1.githubusercontent.com/u/279390?v=4" width="48px;" alt=""/><br /><sub><b>Dan Rabinowitz</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/dvdmssmnn"><img src="https://avatars1.githubusercontent.com/u/6897575?v=4" width="48px;" alt=""/><br /><sub><b>David Missmann</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/mweb"><img src="https://avatars2.githubusercontent.com/u/882006?v=4" width="48px;" alt=""/><br /><sub><b>Mathias Weber</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/TheRedSpy15"><img src="https://avatars1.githubusercontent.com/u/32081703?v=4" width="48px;" alt=""/><br /><sub><b>TheRedSpy15</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://www.linkedin.com/in/harald-nordgren-44778192"><img src="https://avatars0.githubusercontent.com/u/9569897?v=4" width="48px;" alt=""/><br /><sub><b>Harald Nordgren</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://stormfirefox1.github.io"><img src="https://avatars0.githubusercontent.com/u/11583824?v=4" width="48px;" alt=""/><br /><sub><b>Matei Alexandru Gardus</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/Seanstoppable"><img src="https://avatars2.githubusercontent.com/u/1523955?v=4" width="48px;" alt=""/><br /><sub><b>Sean Smith</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://kaskavalci.com"><img src="https://avatars1.githubusercontent.com/u/1646238?v=4" width="48px;" alt=""/><br /><sub><b>Halil Kaskavalci</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://www.johandenoyer.fr"><img src="https://avatars2.githubusercontent.com/u/246715?v=4" width="48px;" alt=""/><br /><sub><b>Johan Denoyer</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://skymeyer.be"><img src="https://avatars1.githubusercontent.com/u/593516?v=4" width="48px;" alt=""/><br /><sub><b>Jelle Vink</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://imdevinc.com"><img src="https://avatars1.githubusercontent.com/u/3997333?v=4" width="48px;" alt=""/><br /><sub><b>Devin Collins</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="http://danne.stayskal.com/"><img src="https://avatars3.githubusercontent.com/u/18333?v=4" width="48px;" alt=""/><br /><sub><b>Danne Stayskal</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://www.maxbeizer.com"><img src="https://avatars1.githubusercontent.com/u/2006658?v=4" width="48px;" alt=""/><br /><sub><b>Max Beizer</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://tinyurl.com/nwmj4as"><img src="https://avatars1.githubusercontent.com/u/194392?v=4" width="48px;" alt=""/><br /><sub><b>E:V:A</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/GaboFDC"><img src="https://avatars0.githubusercontent.com/u/1425500?v=4" width="48px;" alt=""/><br /><sub><b>Gabriel</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/AndrewScibek"><img src="https://avatars2.githubusercontent.com/u/10111411?v=4" width="48px;" alt=""/><br /><sub><b>Andrew Scibek</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/FriedCosey"><img src="https://avatars0.githubusercontent.com/u/29709822?v=4" width="48px;" alt=""/><br /><sub><b>FriedCosey</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://michelegera.dev/"><img src="https://avatars1.githubusercontent.com/u/3891?v=4" width="48px;" alt=""/><br /><sub><b>Michele Gerarduzzi</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/rudolphjacksonm"><img src="https://avatars3.githubusercontent.com/u/13438569?v=4" width="48px;" alt=""/><br /><sub><b>Jack Morris</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/foorb"><img src="https://avatars0.githubusercontent.com/u/14993807?v=4" width="48px;" alt=""/><br /><sub><b>foorb</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://researchit.las.iastate.edu"><img src="https://avatars0.githubusercontent.com/u/5819098?v=4" width="48px;" alt=""/><br /><sub><b>Levi Baber</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/gnanderson"><img src="https://avatars0.githubusercontent.com/u/38514?v=4" width="48px;" alt=""/><br /><sub><b>Graham Anderson</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/bosr"><img src="https://avatars2.githubusercontent.com/u/1936828?v=4" width="48px;" alt=""/><br /><sub><b>Romain Bossart</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://eonix.ru"><img src="https://avatars0.githubusercontent.com/u/969838?v=4" width="48px;" alt=""/><br /><sub><b>Kirill Motkov</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://www.BrianChoromanski.com"><img src="https://avatars1.githubusercontent.com/u/3665694?v=4" width="48px;" alt=""/><br /><sub><b>Brian Choromanski</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="http://siobud.com"><img src="https://avatars0.githubusercontent.com/u/1302304?v=4" width="48px;" alt=""/><br /><sub><b>Sean DuBois</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/gary-kim"><img src="https://avatars1.githubusercontent.com/u/47195730?v=4" width="48px;" alt=""/><br /><sub><b>Gary Kim</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://dylanbartels.com"><img src="https://avatars1.githubusercontent.com/u/6660171?v=4" width="48px;" alt=""/><br /><sub><b>Dylan</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://liet.me"><img src="https://avatars0.githubusercontent.com/u/1990354?v=4" width="48px;" alt=""/><br /><sub><b>Dmytro Prokhorenkov</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/elliotrushton"><img src="https://avatars1.githubusercontent.com/u/590442?v=4" width="48px;" alt=""/><br /><sub><b>Elliot</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://chenrui.dev"><img src="https://avatars3.githubusercontent.com/u/1580956?v=4" width="48px;" alt=""/><br /><sub><b>chenrui</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/sudermanjr"><img src="https://avatars0.githubusercontent.com/u/7624765?v=4" width="48px;" alt=""/><br /><sub><b>Andrew Suderman</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/rwhogg"><img src="https://avatars3.githubusercontent.com/u/2373856?v=4" width="48px;" alt=""/><br /><sub><b>Bob 'Wombat' Hogg</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/hxw"><img src="https://avatars0.githubusercontent.com/u/143462?v=4" width="48px;" alt=""/><br /><sub><b>Christopher Hall</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/hneiva"><img src="https://avatars1.githubusercontent.com/u/3451557?v=4" width="48px;" alt=""/><br /><sub><b>Heitor Neiva</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/herbygillot"><img src="https://avatars3.githubusercontent.com/u/618376?v=4" width="48px;" alt=""/><br /><sub><b>Herby Gillot</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://brudil.com"><img src="https://avatars3.githubusercontent.com/u/382352?v=4" width="48px;" alt=""/><br /><sub><b>James Canning</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://twitter.com/jeffz4000"><img src="https://avatars1.githubusercontent.com/u/45892?v=4" width="48px;" alt=""/><br /><sub><b>jeffz</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://mikkeljuhl.com"><img src="https://avatars0.githubusercontent.com/u/1764035?v=4" width="48px;" alt=""/><br /><sub><b>Mikkel Jeppesen Juhl</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/lesteenman"><img src="https://avatars1.githubusercontent.com/u/963290?v=4" width="48px;" alt=""/><br /><sub><b>Erik</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/nyourchuck"><img src="https://avatars1.githubusercontent.com/u/155574?v=4" width="48px;" alt=""/><br /><sub><b>Nate Yourchuck</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://cprimozic.net/"><img src="https://avatars3.githubusercontent.com/u/4335849?v=4" width="48px;" alt=""/><br /><sub><b>Casey Primozic</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://pierdelacabeza.com/maruja"><img src="https://avatars3.githubusercontent.com/u/2430915?v=4" width="48px;" alt=""/><br /><sub><b>Alvaro [Andor]</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/Midnight-Conqueror"><img src="https://avatars1.githubusercontent.com/u/17101621?v=4" width="48px;" alt=""/><br /><sub><b>Joel Valentine</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://www.viktor-braun.de"><img src="https://avatars0.githubusercontent.com/u/4738210?v=4" width="48px;" alt=""/><br /><sub><b>Viktor Braun</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://www.chrisdbrown.co.uk/"><img src="https://avatars3.githubusercontent.com/u/3877652?v=4" width="48px;" alt=""/><br /><sub><b>ChrisDBrown</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://narengowda.github.io/"><img src="https://avatars2.githubusercontent.com/u/582821?v=4" width="48px;" alt=""/><br /><sub><b>Narendra L</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/ibaum"><img src="https://avatars1.githubusercontent.com/u/24609103?v=4" width="48px;" alt=""/><br /><sub><b>ibaum</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/noxer"><img src="https://avatars3.githubusercontent.com/u/566185?v=4" width="48px;" alt=""/><br /><sub><b>Tim Scheuermann</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://indradhanush.github.io/"><img src="https://avatars0.githubusercontent.com/u/2682729?v=4" width="48px;" alt=""/><br /><sub><b>Indradhanush Gupta</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://victoravelar.com"><img src="https://avatars3.githubusercontent.com/u/7926849?v=4" width="48px;" alt=""/><br /><sub><b>Victor Hugo Avelar Ossorio</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/scw007"><img src="https://avatars3.githubusercontent.com/u/4001640?v=4" width="48px;" alt=""/><br /><sub><b>Steven Whitehead</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/lawrencecraft"><img src="https://avatars0.githubusercontent.com/u/660580?v=4" width="48px;" alt=""/><br /><sub><b>Lawrence Craft</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="http://avi.press"><img src="https://avatars1.githubusercontent.com/u/1388071?v=4" width="48px;" alt=""/><br /><sub><b>Avi Press</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/Tardog"><img src="https://avatars0.githubusercontent.com/u/22562624?v=4" width="48px;" alt=""/><br /><sub><b>Sarah Kraßnigg</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://jmks.ca"><img src="https://avatars1.githubusercontent.com/u/4923990?v=4" width="48px;" alt=""/><br /><sub><b>Jason Schweier</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/massa1240"><img src="https://avatars2.githubusercontent.com/u/8268483?v=4" width="48px;" alt=""/><br /><sub><b>Massa</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://boot-error.github.io"><img src="https://avatars3.githubusercontent.com/u/8546140?v=4" width="48px;" alt=""/><br /><sub><b>Vighnesh SK</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://alexfornuto.com"><img src="https://avatars3.githubusercontent.com/u/2349184?v=4" width="48px;" alt=""/><br /><sub><b>Alex Fornuto</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/stevenwhitehead"><img src="https://avatars0.githubusercontent.com/u/30630257?v=4" width="48px;" alt=""/><br /><sub><b>stevenwhitehead</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/jdenoy-saagie"><img src="https://avatars2.githubusercontent.com/u/55875303?v=4" width="48px;" alt=""/><br /><sub><b>Johan Denoyer</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://albertsalim.dev"><img src="https://avatars1.githubusercontent.com/u/4749355?v=4" width="48px;" alt=""/><br /><sub><b>Albert Salim</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://Feliciano.Tech"><img src="https://avatars1.githubusercontent.com/u/6017470?v=4" width="48px;" alt=""/><br /><sub><b>Ricardo N Feliciano</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/3mard"><img src="https://avatars3.githubusercontent.com/u/42009880?v=4" width="48px;" alt=""/><br /><sub><b>Omer Davutoglu</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/hemu"><img src="https://avatars0.githubusercontent.com/u/1871299?v=4" width="48px;" alt=""/><br /><sub><b>Hemu</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/Daanikus"><img src="https://avatars0.githubusercontent.com/u/18027087?v=4" width="48px;" alt=""/><br /><sub><b>Dan Bent</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://cizer.dev"><img src="https://avatars3.githubusercontent.com/u/20225764?v=4" width="48px;" alt=""/><br /><sub><b>C123R</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/madepolli"><img src="https://avatars1.githubusercontent.com/u/7237000?v=4" width="48px;" alt=""/><br /><sub><b>Matjaž Depolli</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://blog.schoentoon.blue"><img src="https://avatars1.githubusercontent.com/u/417618?v=4" width="48px;" alt=""/><br /><sub><b>Toon Schoenmakers</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://tdhttt.com"><img src="https://avatars2.githubusercontent.com/u/24703459?v=4" width="48px;" alt=""/><br /><sub><b>TDHTTTT</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/jottr"><img src="https://avatars0.githubusercontent.com/u/2744198?v=4" width="48px;" alt=""/><br /><sub><b>jottr</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://www.linkedin.com/in/nikolay-mateev-79187b167/"><img src="https://avatars3.githubusercontent.com/u/15074116?v=4" width="48px;" alt=""/><br /><sub><b>Nikolay Mateev</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://charliewang.io"><img src="https://avatars1.githubusercontent.com/u/1320418?v=4" width="48px;" alt=""/><br /><sub><b>Charlie Wang</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/liyiheng"><img src="https://avatars3.githubusercontent.com/u/16461061?v=4" width="48px;" alt=""/><br /><sub><b>liyiheng</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://bjoern.svbtle.com"><img src="https://avatars1.githubusercontent.com/u/1467156?v=4" width="48px;" alt=""/><br /><sub><b>Bjoern Weidlich</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/firecat53"><img src="https://avatars1.githubusercontent.com/u/568113?v=4" width="48px;" alt=""/><br /><sub><b>Scott Hansen</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://davidsbond.github.io"><img src="https://avatars3.githubusercontent.com/u/6227720?v=4" width="48px;" alt=""/><br /><sub><b>David Bond</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/yesnault"><img src="https://avatars3.githubusercontent.com/u/395454?v=4" width="48px;" alt=""/><br /><sub><b>Yvonnick Esnault</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/leterio"><img src="https://avatars0.githubusercontent.com/u/15060358?v=4" width="48px;" alt=""/><br /><sub><b>Vinícius Letério</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://adriano.fyi"><img src="https://avatars3.githubusercontent.com/u/3331648?v=4" width="48px;" alt=""/><br /><sub><b>Adriano</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/jonhadfield"><img src="https://avatars1.githubusercontent.com/u/843944?v=4" width="48px;" alt=""/><br /><sub><b>Jon Hadfield</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/Tdnshah"><img src="https://avatars2.githubusercontent.com/u/13272752?v=4" width="48px;" alt=""/><br /><sub><b>Tejas Shah</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/mogensen"><img src="https://avatars2.githubusercontent.com/u/592710?v=4" width="48px;" alt=""/><br /><sub><b>Frederik Mogensen</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/rsaarelm"><img src="https://avatars1.githubusercontent.com/u/41840?v=4" width="48px;" alt=""/><br /><sub><b>Risto Saarelma</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://sam-github.github.io/"><img src="https://avatars2.githubusercontent.com/u/17607?v=4" width="48px;" alt=""/><br /><sub><b>Sam Roberts</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/gerchardon"><img src="https://avatars0.githubusercontent.com/u/5973160?v=4" width="48px;" alt=""/><br /><sub><b>gerchardon</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/mryanmurphy"><img src="https://avatars2.githubusercontent.com/u/641427?v=4" width="48px;" alt=""/><br /><sub><b>Matt</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://devco.net/"><img src="https://avatars0.githubusercontent.com/u/82342?v=4" width="48px;" alt=""/><br /><sub><b>R.I.Pienaar</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/fmotrifork"><img src="https://avatars3.githubusercontent.com/u/18327738?v=4" width="48px;" alt=""/><br /><sub><b>Frederik Mogensen</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/aeter"><img src="https://avatars0.githubusercontent.com/u/238607?v=4" width="48px;" alt=""/><br /><sub><b>aeter</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://timhwang21.gitbook.io"><img src="https://avatars3.githubusercontent.com/u/5831434?v=4" width="48px;" alt=""/><br /><sub><b>Tim Hwang</b></sub></a><br /></td>
|
||||
<td align="center"><a href="http://about.me/yingfan"><img src="https://avatars1.githubusercontent.com/u/10404961?v=4" width="48px;" alt=""/><br /><sub><b>Ying Fan Chong</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/MartinJohns"><img src="https://avatars1.githubusercontent.com/u/5269069?v=4" width="48px;" alt=""/><br /><sub><b>Martin Johns</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://www.jvt.me"><img src="https://avatars0.githubusercontent.com/u/3315059?v=4" width="48px;" alt=""/><br /><sub><b>Jamie Tanna</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/trimble"><img src="https://avatars3.githubusercontent.com/u/371317?v=4" width="48px;" alt=""/><br /><sub><b>Todd Trimble</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://www.mitchellhanberg.com"><img src="https://avatars2.githubusercontent.com/u/5523984?v=4" width="48px;" alt=""/><br /><sub><b>Mitchell Hanberg</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://franga2000.com"><img src="https://avatars3.githubusercontent.com/u/3891092?v=4" width="48px;" alt=""/><br /><sub><b>Miha Frangež</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://blog.sahilister.in/"><img src="https://avatars0.githubusercontent.com/u/52946452?v=4" width="48px;" alt=""/><br /><sub><b>Sahil Dhiman</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://pzoo.netlify.app/"><img src="https://avatars2.githubusercontent.com/u/17727004?v=4" width="48px;" alt=""/><br /><sub><b>Pingzhou | 平舟</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/YuviGold"><img src="https://avatars0.githubusercontent.com/u/29873449?v=4" width="48px;" alt=""/><br /><sub><b>Yuval Goldberg</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/dabcoder"><img src="https://avatars3.githubusercontent.com/u/5034531?v=4" width="48px;" alt=""/><br /><sub><b>David Bouchare</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/stone"><img src="https://avatars3.githubusercontent.com/u/29077?v=4" width="48px;" alt=""/><br /><sub><b>Fredrik Steen</b></sub></a><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/zye1996"><img src="https://avatars2.githubusercontent.com/u/28901953?v=4" width="48px;" alt=""/><br /><sub><b>zye1996</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/pgaxatte"><img src="https://avatars.githubusercontent.com/u/30696904?v=4" width="48px;" alt=""/><br /><sub><b>Pierre Gaxatte</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://xntrik.wtf"><img src="https://avatars.githubusercontent.com/u/678260?v=4" width="48px;" alt=""/><br /><sub><b>Christian Frichot</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://lukas-kaemmerling.de"><img src="https://avatars.githubusercontent.com/u/4281581?v=4" width="48px;" alt=""/><br /><sub><b>Lukas Kämmerling</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://inetant.net/"><img src="https://avatars.githubusercontent.com/u/1765366?v=4" width="48px;" alt=""/><br /><sub><b>Antoine Meillet</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://www.patreon.com/cclauss"><img src="https://avatars.githubusercontent.com/u/3709715?v=4" width="48px;" alt=""/><br /><sub><b>Christian Clauss</b></sub></a><br /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-enable -->
|
||||
<!-- prettier-ignore-end -->
|
||||
<!-- prettier-ignore -->
|
||||
| [<img src="https://avatars0.githubusercontent.com/u/6413?v=4" width="48px;" alt="Chris Cummer"/><br /><sub><b>Chris Cummer</b></sub>](https://twitter.com/senorprogrammer)<br /> | [<img src="https://avatars2.githubusercontent.com/u/3252403?v=4" width="48px;" alt="Anand Sudhir Prayaga"/><br /><sub><b>Anand Sudhir Prayaga</b></sub>](https://github.com/anandsudhir)<br /> | [<img src="https://avatars1.githubusercontent.com/u/34973359?v=4" width="48px;" alt="Hossein Mehrabi"/><br /><sub><b>Hossein Mehrabi</b></sub>](https://github.com/jeangovil)<br /> | [<img src="https://avatars0.githubusercontent.com/u/11779018?v=4" width="48px;" alt="FengYa"/><br /><sub><b>FengYa</b></sub>](https://github.com/Fengyalv)<br /> | [<img src="https://avatars2.githubusercontent.com/u/17337753?v=4" width="48px;" alt="deltax"/><br /><sub><b>deltax</b></sub>](https://fluxionnetwork.github.io/fluxion/)<br /> | [<img src="https://avatars0.githubusercontent.com/u/1319630?v=4" width="48px;" alt="Bill Keenan"/><br /><sub><b>Bill Keenan</b></sub>](https://github.com/BillKeenan)<br /> | [<img src="https://avatars2.githubusercontent.com/u/118081?v=4" width="48px;" alt="June S"/><br /><sub><b>June S</b></sub>](http://blog.sapara.com)<br /> |
|
||||
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
||||
| [<img src="https://avatars3.githubusercontent.com/u/16461061?v=4" width="48px;" alt="liyiheng"/><br /><sub><b>liyiheng</b></sub>](https://github.com/XanthusL)<br /> | [<img src="https://avatars2.githubusercontent.com/u/9014288?v=4" width="48px;" alt="baustinanki"/><br /><sub><b>baustinanki</b></sub>](https://github.com/baustinanki)<br /> | [<img src="https://avatars0.githubusercontent.com/u/371475?v=4" width="48px;" alt="lucus lee"/><br /><sub><b>lucus lee</b></sub>](https://github.com/lixin9311)<br /> | [<img src="https://avatars1.githubusercontent.com/u/7537841?v=4" width="48px;" alt="Mike Lloyd"/><br /><sub><b>Mike Lloyd</b></sub>](https://github.com/mxplusb)<br /> | [<img src="https://avatars3.githubusercontent.com/u/10998?v=4" width="48px;" alt="Sergio Rubio"/><br /><sub><b>Sergio Rubio</b></sub>](http://rubiojr.rbel.co)<br /> | [<img src="https://avatars3.githubusercontent.com/u/17374492?v=4" width="48px;" alt="Farhad Farahi"/><br /><sub><b>Farhad Farahi</b></sub>](https://github.com/FarhadF)<br /> | [<img src="https://avatars1.githubusercontent.com/u/634604?v=4" width="48px;" alt="Lasantha Kularatne"/><br /><sub><b>Lasantha Kularatne</b></sub>](http://lasantha.blogspot.com/)<br /> |
|
||||
| [<img src="https://avatars1.githubusercontent.com/u/823331?v=4" width="48px;" alt="Mark Old"/><br /><sub><b>Mark Old</b></sub>](https://github.com/dlom)<br /> | [<img src="https://avatars0.githubusercontent.com/u/5546718?v=4" width="48px;" alt="flw"/><br /><sub><b>flw</b></sub>](http://flw.tools/)<br /> | [<img src="https://avatars0.githubusercontent.com/u/6024927?v=4" width="48px;" alt="David Barda"/><br /><sub><b>David Barda</b></sub>](https://github.com/davebarda)<br /> | [<img src="https://avatars2.githubusercontent.com/u/4261980?v=4" width="48px;" alt="Geoff Lee"/><br /><sub><b>Geoff Lee</b></sub>](https://github.com/matrinox)<br /> | [<img src="https://avatars3.githubusercontent.com/u/1022918?v=4" width="48px;" alt="George Opritescu"/><br /><sub><b>George Opritescu</b></sub>](http://international.github.io)<br /> | [<img src="https://avatars3.githubusercontent.com/u/497310?v=4" width="48px;" alt="Grazfather"/><br /><sub><b>Grazfather</b></sub>](https://twitter.com/Grazfather)<br /> | [<img src="https://avatars2.githubusercontent.com/u/1691120?v=4" width="48px;" alt="Michael Cordell"/><br /><sub><b>Michael Cordell</b></sub>](http://www.mikecordell.com/)<br /> |
|
||||
| [<img src="https://avatars2.githubusercontent.com/u/1215497?v=4" width="48px;" alt="Patrick José Pereira"/><br /><sub><b>Patrick José Pereira</b></sub>](http://patrick.ibexcps.com)<br /> | [<img src="https://avatars2.githubusercontent.com/u/1483092?v=4" width="48px;" alt="sherod taylor"/><br /><sub><b>sherod taylor</b></sub>](https://github.com/sherodtaylor)<br /> | [<img src="https://avatars2.githubusercontent.com/u/3062663?v=4" width="48px;" alt="Andrew Scott"/><br /><sub><b>Andrew Scott</b></sub>](http://cogentia.io)<br /> | [<img src="https://avatars1.githubusercontent.com/u/12018440?v=4" width="48px;" alt="Lassi Piironen"/><br /><sub><b>Lassi Piironen</b></sub>](https://github.com/lsipii)<br /> | [<img src="https://avatars0.githubusercontent.com/u/14799210?v=4" width="48px;" alt="BlackWebWolf"/><br /><sub><b>BlackWebWolf</b></sub>](https://github.com/BlackWebWolf)<br /> | [<img src="https://avatars0.githubusercontent.com/u/1894885?v=4" width="48px;" alt="andrewzolotukhin"/><br /><sub><b>andrewzolotukhin</b></sub>](https://github.com/andrewzolotukhin)<br /> | [<img src="https://avatars1.githubusercontent.com/u/8568280?v=4" width="48px;" alt="Leon Stigter"/><br /><sub><b>Leon Stigter</b></sub>](https://retgits.github.io)<br /> |
|
||||
| [<img src="https://avatars3.githubusercontent.com/u/21756?v=4" width="48px;" alt="Amr Tamimi"/><br /><sub><b>Amr Tamimi</b></sub>](https://tamimi.se)<br /> | [<img src="https://avatars3.githubusercontent.com/u/3717137?v=4" width="48px;" alt="Jagdeep Singh"/><br /><sub><b>Jagdeep Singh</b></sub>](https://jagdeep.me)<br /> | [<img src="https://avatars0.githubusercontent.com/u/889171?v=4" width="48px;" alt="Lineu Felipe"/><br /><sub><b>Lineu Felipe</b></sub>](https://github.com/darkSasori)<br /> | [<img src="https://avatars2.githubusercontent.com/u/159124?v=4" width="48px;" alt="Konstantin"/><br /><sub><b>Konstantin</b></sub>](https://github.com/kvj)<br /> | [<img src="https://avatars2.githubusercontent.com/u/6044920?v=4" width="48px;" alt="Brendan O'Leary"/><br /><sub><b>Brendan O'Leary</b></sub>](http://www.brendanoleary.com)<br /> | [<img src="https://avatars2.githubusercontent.com/u/1226441?v=4" width="48px;" alt="bertl4398"/><br /><sub><b>bertl4398</b></sub>](https://github.com/bertl4398)<br /> | [<img src="https://avatars2.githubusercontent.com/u/6553695?v=4" width="48px;" alt="Ferenc-"/><br /><sub><b>Ferenc-</b></sub>](https://github.com/Ferenc-)<br /> |
|
||||
| [<img src="https://avatars1.githubusercontent.com/u/952036?v=4" width="48px;" alt="Rohan Verma"/><br /><sub><b>Rohan Verma</b></sub>](http://rohanverma.net)<br /> | [<img src="https://avatars1.githubusercontent.com/u/19293566?v=4" width="48px;" alt="Tim Fitzgerald"/><br /><sub><b>Tim Fitzgerald</b></sub>](https://github.com/fimtitzgerald)<br /> | [<img src="https://avatars2.githubusercontent.com/u/1081051?v=4" width="48px;" alt="Federico Ruggi"/><br /><sub><b>Federico Ruggi</b></sub>](https://github.com/ruggi)<br /> | [<img src="https://avatars2.githubusercontent.com/u/7293328?v=4" width="48px;" alt="Craig Woodward"/><br /><sub><b>Craig Woodward</b></sub>](https://github.com/ctwoodward)<br /> | [<img src="https://avatars3.githubusercontent.com/u/15367484?v=4" width="48px;" alt="ReadmeCritic"/><br /><sub><b>ReadmeCritic</b></sub>](https://twitter.com/ReadmeCritic)<br /> | [<img src="https://avatars0.githubusercontent.com/u/141402?v=4" width="48px;" alt="Eugene"/><br /><sub><b>Eugene</b></sub>](https://github.com/jdevelop)<br /> | [<img src="https://avatars1.githubusercontent.com/u/12983705?s=460&v=4" width="48px;" alt="Kenny Wu"/><br /><sub><b>Kenny Wu</b></sub>](https://github.com/Trinergy)<br /> |
|
||||
| [<img src="https://avatars0.githubusercontent.com/u/538234?v=4" width="48px;" alt="Renán Romero"/><br /><sub><b>Renán Romero</b></sub>](http://www.romeroruiz.com)<br /> | [<img src="https://avatars1.githubusercontent.com/u/5031240?v=4" width="48px;" alt="Bastian Groß"/><br /><sub><b>Bastian Groß</b></sub>](https://github.com/sticreations)<br /> | [<img src="https://avatars1.githubusercontent.com/u/2496835?v=4" width="48px;" alt="nicholas-eden"/><br /><sub><b>nicholas-eden</b></sub>](https://github.com/nicholas-eden)<br /> | [<img src="https://avatars1.githubusercontent.com/u/279390?v=4" width="48px;" alt="Dan Rabinowitz"/><br /><sub><b>Dan Rabinowitz</b></sub>](https://github.com/danrabinowitz)<br /> | [<img src="https://avatars1.githubusercontent.com/u/6897575?v=4" width="48px;" alt="David Missmann"/><br /><sub><b>David Missmann</b></sub>](https://github.com/dvdmssmnn)<br /> | [<img src="https://avatars2.githubusercontent.com/u/882006?v=4" width="48px;" alt="Mathias Weber"/><br /><sub><b>Mathias Weber</b></sub>](https://github.com/mweb)<br /> | [<img src="https://avatars1.githubusercontent.com/u/32081703?v=4" width="48px;" alt="TheRedSpy15"/><br /><sub><b>TheRedSpy15</b></sub>](https://github.com/TheRedSpy15)<br /> |
|
||||
| [<img src="https://avatars0.githubusercontent.com/u/9569897?v=4" width="48px;" alt="Harald Nordgren"/><br /><sub><b>Harald Nordgren</b></sub>](https://www.linkedin.com/in/harald-nordgren-44778192)<br /> | [<img src="https://avatars0.githubusercontent.com/u/11583824?v=4" width="48px;" alt="Matei Alexandru Gardus"/><br /><sub><b>Matei Alexandru Gardus</b></sub>](http://stormfirefox1.github.io)<br /> | [<img src="https://avatars2.githubusercontent.com/u/1523955?v=4" width="48px;" alt="Sean Smith"/><br /><sub><b>Sean Smith</b></sub>](https://github.com/Seanstoppable)<br /> | [<img src="https://avatars1.githubusercontent.com/u/1646238?v=4" width="48px;" alt="Halil Kaskavalci"/><br /><sub><b>Halil Kaskavalci</b></sub>](http://kaskavalci.com)<br /> | [<img src="https://avatars2.githubusercontent.com/u/246715?v=4" width="48px;" alt="Johan Denoyer"/><br /><sub><b>Johan Denoyer</b></sub>](http://www.johandenoyer.fr)<br /> | [<img src="https://avatars1.githubusercontent.com/u/593516?v=4" width="48px;" alt="Jelle Vink"/><br /><sub><b>Jelle Vink</b></sub>](https://skymeyer.be)<br /> | [<img src="https://avatars1.githubusercontent.com/u/3997333?v=4" width="48px;" alt="Devin Collins"/><br /><sub><b>Devin Collins</b></sub>](http://imdevinc.com)<br /> |
|
||||
| [<img src="https://avatars3.githubusercontent.com/u/18333?v=4" width="48px;" alt="Danne Stayskal"/><br /><sub><b>Danne Stayskal</b></sub>](http://danne.stayskal.com/)<br /> | [<img src="https://avatars1.githubusercontent.com/u/2006658?v=4" width="48px;" alt="Max Beizer"/><br /><sub><b>Max Beizer</b></sub>](https://www.maxbeizer.com)<br /> |
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
## Acknowledgments
|
||||
@ -437,7 +77,8 @@ Dependency management in WTF is handled by [Go modules](https://github.com/golan
|
||||
The inspiration for `WTF` came from Monica Dinculescu's
|
||||
[tiny-care-terminal](https://github.com/notwaldorf/tiny-care-terminal).
|
||||
|
||||
WTF is built atop [tcell](https://github.com/gdamore/tcell) and [tview](https://github.com/rivo/tview), fantastic projects both. WTF is built, packaged, and deployed via [GoReleaser](https://goreleaser.com).
|
||||
Many thanks to <a href="https://lendesk.com">Lendesk</a> for supporting this project by
|
||||
providing time to develop it.
|
||||
|
||||
<p align="center">
|
||||
<img src="./images/dude_wtf.png?raw=true" title="Dude WTF" width="251" height="201" />
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 196 KiB |
@ -14,8 +14,9 @@ wtf:
|
||||
graphIcon: "💀"
|
||||
graphStars: 25
|
||||
position:
|
||||
top: 1
|
||||
top: 2
|
||||
left: 0
|
||||
height: 2
|
||||
width: 2
|
||||
refreshInterval: 30
|
||||
refreshInterval: 30
|
||||
updateInterval: 15
|
||||
|
236
_sample_configs/complex_config.yml
Normal file
236
_sample_configs/complex_config.yml
Normal file
@ -0,0 +1,236 @@
|
||||
wtf:
|
||||
colors:
|
||||
background: gray
|
||||
border:
|
||||
focusable: darkslateblue
|
||||
focused: orange
|
||||
normal: gray
|
||||
grid:
|
||||
# How _wide_ the columns are, in terminal characters. In this case we have
|
||||
# five columns, each of which are 37 characters wide
|
||||
columns: [37, 37, 37, 37, 37]
|
||||
|
||||
# How _high_ the rows are, in terminal lines. In this case we have five rows
|
||||
# that support ten line of text, and one of four
|
||||
rows: [10, 10, 10, 10, 10, 4]
|
||||
refreshInterval: 1
|
||||
mods:
|
||||
bamboohr:
|
||||
enabled: true
|
||||
position:
|
||||
top: 0
|
||||
left: 0
|
||||
height: 2
|
||||
width: 1
|
||||
refreshInterval: 900
|
||||
clocks:
|
||||
colors:
|
||||
rows:
|
||||
even: "lightblue"
|
||||
odd: "white"
|
||||
enabled: true
|
||||
locations:
|
||||
# From https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
Avignon: "Europe/Paris"
|
||||
Barcelona: "Europe/Madrid"
|
||||
Dubai: "Asia/Dubai"
|
||||
UTC: "Etc/UTC"
|
||||
Vancouver: "America/Vancouver"
|
||||
Toronto: "America/Toronto"
|
||||
position:
|
||||
top: 3
|
||||
left: 1
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 15
|
||||
# Valid options are: alphabetical, chronological
|
||||
sort: "alphabetical"
|
||||
cmdrunner:
|
||||
args: ["-g", "batt"]
|
||||
cmd: "pmset"
|
||||
enabled: true
|
||||
position:
|
||||
top: 6
|
||||
left: 2
|
||||
height: 1
|
||||
width: 2
|
||||
refreshInterval: 30
|
||||
gcal:
|
||||
colors:
|
||||
title: "red"
|
||||
description: "lightblue"
|
||||
highlights:
|
||||
- ['1on1|1\/11', 'green']
|
||||
- ['apple|google|aws', 'blue']
|
||||
- ['interview|meet\ ', 'lightseagreen']
|
||||
- ['lunch', 'yellow']
|
||||
past: "gray"
|
||||
conflictIcon: "🚨"
|
||||
currentIcon: "💥"
|
||||
displayResponseStatus: true
|
||||
email: "your.email@example.com"
|
||||
enabled: true
|
||||
eventCount: 12
|
||||
position:
|
||||
top: 0
|
||||
left: 0
|
||||
height: 4
|
||||
width: 1
|
||||
refreshInterval: 300
|
||||
secretFile: "~/.config/wtf/gcal/client_secret.json"
|
||||
withLocation: true
|
||||
gspreadsheets:
|
||||
colors:
|
||||
values: "green"
|
||||
cells:
|
||||
names:
|
||||
- "Cell 1 name"
|
||||
- "Cell 2 name"
|
||||
addresses:
|
||||
- "A1"
|
||||
- "A2"
|
||||
enabled: true
|
||||
position:
|
||||
top: 0
|
||||
left: 0
|
||||
width: 1
|
||||
height: 1
|
||||
refreshInterval: "300"
|
||||
secretFile: "~/.config/wtf/gspreadsheets/client_secret.json"
|
||||
sheetId: "id_of_google_spreadsheet"
|
||||
git:
|
||||
commitCount: 5
|
||||
enabled: true
|
||||
position:
|
||||
top: 0
|
||||
left: 2
|
||||
height: 2
|
||||
width: 3
|
||||
refreshInterval: 8
|
||||
repositories:
|
||||
- "/Users/chris/go/src/github.com/wtfutil/wtf"
|
||||
github:
|
||||
enabled: true
|
||||
position:
|
||||
top: 2
|
||||
left: 2
|
||||
height: 2
|
||||
width: 3
|
||||
refreshInterval: 300
|
||||
repositories:
|
||||
repo-name: "owner id"
|
||||
wtf: "wtfutil"
|
||||
username: "wtfutil"
|
||||
jira:
|
||||
colors:
|
||||
rows:
|
||||
even: "lightblue"
|
||||
odd: "white"
|
||||
domain: "https://company.atlassian.net"
|
||||
enabled: true
|
||||
position:
|
||||
top: 1
|
||||
left: 1
|
||||
height: 1
|
||||
width: 1
|
||||
project: "WTF"
|
||||
refreshInterval: 900
|
||||
username: "chris.cummer"
|
||||
newrelic:
|
||||
applicationId: 10594735
|
||||
enabled: true
|
||||
deployCount: 10
|
||||
position:
|
||||
top: 4
|
||||
left: 2
|
||||
height: 2
|
||||
width: 3
|
||||
refreshInterval: 900
|
||||
opsgenie:
|
||||
displayEmpty: true
|
||||
enabled: true
|
||||
position:
|
||||
top: 2
|
||||
left: 0
|
||||
height: 2
|
||||
width: 1
|
||||
refreshInterval: 21600
|
||||
power:
|
||||
enabled: true
|
||||
position:
|
||||
top: 5
|
||||
left: 0
|
||||
height: 2
|
||||
width: 1
|
||||
refreshInterval: 15
|
||||
security:
|
||||
enabled: true
|
||||
position:
|
||||
top: 4
|
||||
left: 0
|
||||
height: 2
|
||||
width: 1
|
||||
refreshInterval: 3600
|
||||
status:
|
||||
enabled: false
|
||||
position:
|
||||
top: 5
|
||||
left: 0
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 1
|
||||
system:
|
||||
enabled: true
|
||||
position:
|
||||
top: 5
|
||||
left: 1
|
||||
height: 2
|
||||
width: 1
|
||||
refreshInterval: 3600
|
||||
todo:
|
||||
checkedIcon: "X"
|
||||
colors:
|
||||
checked: gray
|
||||
highlight:
|
||||
fore: "black"
|
||||
back: "orange"
|
||||
enabled: true
|
||||
filename: "todo.yml"
|
||||
position:
|
||||
top: 0
|
||||
left: 1
|
||||
height: 2
|
||||
width: 1
|
||||
refreshInterval: 3600
|
||||
weather:
|
||||
apiKey: [YOUR API KEY]
|
||||
# From http://openweathermap.org/help/city_list.txt
|
||||
cityids:
|
||||
- 3370352
|
||||
- 1283240
|
||||
WTF_OWM_API_KEY: [YOUR API KEY]
|
||||
colors:
|
||||
current: "lightblue"
|
||||
enabled: true
|
||||
language: "EN"
|
||||
position:
|
||||
top: 2
|
||||
left: 1
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 90
|
||||
tempUnit: "C"
|
||||
blockfolio:
|
||||
enabled: true
|
||||
displayHoldings: true
|
||||
refreshInterval: 400
|
||||
device_token: "device token here, you can find how to get it here https://github.com/bob6664569/blockfolio-api-client"
|
||||
colors:
|
||||
name: blue
|
||||
grows: green
|
||||
drop: red
|
||||
position:
|
||||
top: 3
|
||||
left: 1
|
||||
width: 1
|
||||
height: 1
|
@ -1,21 +0,0 @@
|
||||
wtf:
|
||||
mods:
|
||||
battery:
|
||||
type: power
|
||||
title: "⚡️"
|
||||
enabled: true
|
||||
position:
|
||||
top: 0
|
||||
left: 0
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 15
|
||||
security_info:
|
||||
type: security
|
||||
enabled: true
|
||||
position:
|
||||
top: 0
|
||||
left: 1
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 3600
|
Binary file not shown.
Before Width: | Height: | Size: 278 KiB |
@ -1,21 +0,0 @@
|
||||
wtf:
|
||||
colors:
|
||||
border:
|
||||
focusable: darkslateblue
|
||||
focused: orange
|
||||
normal: gray
|
||||
grid:
|
||||
columns: [32, 32, 32, 32, 32, 32]
|
||||
rows: [10, 10, 10, 10, 10, 10]
|
||||
refreshInterval: 2
|
||||
mods:
|
||||
kubernetes:
|
||||
enabled: true
|
||||
kubeconfig: /Users/testuser/.kube/config
|
||||
namespaces: ["demo", "kube-system"]
|
||||
objects: ["nodes","deployments", "pods"]
|
||||
position:
|
||||
top: 0
|
||||
left: 0
|
||||
height: 6
|
||||
width: 3
|
Binary file not shown.
Before Width: | Height: | Size: 891 KiB |
@ -1,180 +0,0 @@
|
||||
wtf:
|
||||
colors:
|
||||
background: black
|
||||
border:
|
||||
focusable: darkslateblue
|
||||
focused: orange
|
||||
normal: gray
|
||||
checked: yellow
|
||||
highlight:
|
||||
fore: black
|
||||
back: gray
|
||||
rows:
|
||||
even: yellow
|
||||
odd: white
|
||||
grid:
|
||||
# How _wide_ the columns are, in terminal characters. In this case we have
|
||||
# four columns, each of which are 35 characters wide.
|
||||
columns: [35, 35, 35, 35]
|
||||
# How _high_ the rows are, in terminal lines. In this case we have four rows
|
||||
# that support ten line of text and one of four.
|
||||
rows: [10, 10, 10, 10, 4]
|
||||
refreshInterval: 1
|
||||
openFileUtil: "open"
|
||||
mods:
|
||||
# You can have multiple widgets of the same type.
|
||||
# The "key" is the name of the widget and the type is the actual
|
||||
# widget you want to implement.
|
||||
europe_time:
|
||||
title: "Europe"
|
||||
type: clocks
|
||||
colors:
|
||||
rows:
|
||||
even: "lightblue"
|
||||
odd: "white"
|
||||
enabled: true
|
||||
locations:
|
||||
GMT: "Etc/GMT"
|
||||
Amsterdam: "Europe/Amsterdam"
|
||||
Berlin: "Europe/Berlin"
|
||||
Barcelona: "Europe/Madrid"
|
||||
Copenhagen: "Europe/Copenhagen"
|
||||
London: "Europe/London"
|
||||
Rome: "Europe/Rome"
|
||||
Stockholm: "Europe/Stockholm"
|
||||
position:
|
||||
top: 0
|
||||
left: 0
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 15
|
||||
sort: "alphabetical"
|
||||
americas_time:
|
||||
title: "Americas"
|
||||
type: clocks
|
||||
colors:
|
||||
rows:
|
||||
even: "lightblue"
|
||||
odd: "white"
|
||||
enabled: true
|
||||
locations:
|
||||
UTC: "Etc/UTC"
|
||||
Vancouver: "America/Vancouver"
|
||||
New_York: "America/New_York"
|
||||
Sao_Paulo: "America/Sao_Paulo"
|
||||
Denver: "America/Denver"
|
||||
Iqaluit: "America/Iqaluit"
|
||||
Bahamas: "America/Nassau"
|
||||
Chicago: "America/Chicago"
|
||||
position:
|
||||
top: 0
|
||||
left: 1
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 15
|
||||
sort: "alphabetical"
|
||||
battery:
|
||||
type: power
|
||||
title: "⚡️"
|
||||
enabled: true
|
||||
position:
|
||||
top: 1
|
||||
left: 3
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 15
|
||||
todolist:
|
||||
type: todo
|
||||
checkedIcon: "X"
|
||||
colors:
|
||||
checked: gray
|
||||
highlight:
|
||||
fore: "black"
|
||||
back: "orange"
|
||||
enabled: true
|
||||
filename: "todo.yml"
|
||||
position:
|
||||
top: 1
|
||||
left: 0
|
||||
height: 2
|
||||
width: 1
|
||||
refreshInterval: 3600
|
||||
ip:
|
||||
type: ipinfo
|
||||
title: "My IP"
|
||||
colors:
|
||||
name: "lightblue"
|
||||
value: "white"
|
||||
enabled: true
|
||||
position:
|
||||
top: 0
|
||||
left: 2
|
||||
height: 1
|
||||
width: 2
|
||||
refreshInterval: 150
|
||||
security_info:
|
||||
type: security
|
||||
title: "Staying safe"
|
||||
enabled: true
|
||||
position:
|
||||
top: 1
|
||||
left: 2
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 3600
|
||||
readme:
|
||||
type: textfile
|
||||
enabled: true
|
||||
filePaths:
|
||||
- "~/.config/wtf/config.yml"
|
||||
format: true
|
||||
formatStyle: "monokai"
|
||||
position:
|
||||
top: 1
|
||||
left: 1
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 15
|
||||
news:
|
||||
type: hackernews
|
||||
title: "HackerNews"
|
||||
enabled: true
|
||||
numberOfStories: 10
|
||||
position:
|
||||
top: 2
|
||||
left: 1
|
||||
height: 1
|
||||
width: 3
|
||||
storyType: top
|
||||
refreshInterval: 900
|
||||
resources:
|
||||
type: resourceusage
|
||||
enabled: true
|
||||
position:
|
||||
top: 3
|
||||
left: 0
|
||||
height: 2
|
||||
width: 1
|
||||
refreshInterval: 1
|
||||
uptime:
|
||||
type: cmdrunner
|
||||
args: [""]
|
||||
cmd: "uptime"
|
||||
enabled: true
|
||||
position:
|
||||
top: 4
|
||||
left: 1
|
||||
height: 1
|
||||
width: 3
|
||||
refreshInterval: 30
|
||||
disks:
|
||||
type: cmdrunner
|
||||
cmd: "df"
|
||||
args: ["-h"]
|
||||
enabled: true
|
||||
position:
|
||||
top: 3
|
||||
left: 1
|
||||
height: 1
|
||||
width: 3
|
||||
refreshInterval: 3600
|
@ -1,104 +1,89 @@
|
||||
package cfg
|
||||
|
||||
const defaultConfigFile = `wtf:
|
||||
wtf:
|
||||
colors:
|
||||
# background: gray
|
||||
border:
|
||||
focusable: darkslateblue
|
||||
focused: orange
|
||||
normal: gray
|
||||
grid:
|
||||
columns: [32, 32, 32, 32, 90]
|
||||
rows: [10, 10, 10, 4, 4, 90]
|
||||
columns: [40, 40]
|
||||
rows: [13, 13, 4, 10]
|
||||
refreshInterval: 1
|
||||
mods:
|
||||
clocks_a:
|
||||
clocks:
|
||||
colors:
|
||||
rows:
|
||||
even: "lightblue"
|
||||
odd: "white"
|
||||
enabled: true
|
||||
locations:
|
||||
Avignon: "Europe/Paris"
|
||||
Barcelona: "Europe/Madrid"
|
||||
Dubai: "Asia/Dubai"
|
||||
UTC: "Etc/UTC"
|
||||
Vancouver: "America/Vancouver"
|
||||
Toronto: "America/Toronto"
|
||||
position:
|
||||
top: 0
|
||||
left: 1
|
||||
left: 0
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 15
|
||||
sort: "alphabetical"
|
||||
title: "Clocks A"
|
||||
type: "clocks"
|
||||
clocks_b:
|
||||
colors:
|
||||
rows:
|
||||
even: "lightblue"
|
||||
odd: "white"
|
||||
enabled: true
|
||||
locations:
|
||||
Paris: "Europe/Paris"
|
||||
Barcelona: "Europe/Madrid"
|
||||
Dubai: "Asia/Dubai"
|
||||
position:
|
||||
top: 0
|
||||
left: 2
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 15
|
||||
sort: "alphabetical"
|
||||
title: "Clocks B"
|
||||
type: "clocks"
|
||||
feedreader:
|
||||
enabled: true
|
||||
feeds:
|
||||
- http://wtfutil.com/blog/index.xml
|
||||
feedLimit: 10
|
||||
position:
|
||||
top: 1
|
||||
left: 1
|
||||
width: 2
|
||||
height: 1
|
||||
refreshInterval: 14400
|
||||
ipinfo:
|
||||
colors:
|
||||
name: "lightblue"
|
||||
value: "white"
|
||||
enabled: true
|
||||
position:
|
||||
top: 2
|
||||
left: 1
|
||||
top: 3
|
||||
left: 0
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 150
|
||||
power:
|
||||
enabled: true
|
||||
position:
|
||||
top: 2
|
||||
left: 2
|
||||
top: 3
|
||||
left: 1
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 15
|
||||
title: "⚡️"
|
||||
textfile:
|
||||
security:
|
||||
enabled: true
|
||||
position:
|
||||
top: 1
|
||||
left: 0
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 3600
|
||||
status:
|
||||
enabled: true
|
||||
position:
|
||||
top: 2
|
||||
left: 0
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 1
|
||||
system:
|
||||
enabled: true
|
||||
filePath: "~/.config/wtf/config.yml"
|
||||
format: true
|
||||
position:
|
||||
top: 0
|
||||
left: 0
|
||||
height: 4
|
||||
width: 1
|
||||
refreshInterval: 30
|
||||
wrapText: false
|
||||
uptime:
|
||||
args: [""]
|
||||
cmd: "uptime"
|
||||
enabled: true
|
||||
position:
|
||||
top: 3
|
||||
left: 1
|
||||
height: 1
|
||||
width: 2
|
||||
refreshInterval: 30
|
||||
type: cmdrunner
|
||||
`
|
||||
width: 1
|
||||
refreshInterval: 3600
|
||||
textfile:
|
||||
enabled: true
|
||||
filePaths:
|
||||
- "~/.config/wtf/config.yml"
|
||||
- "~/.config/wtf/log.txt"
|
||||
format: true
|
||||
formatStyle: "vim"
|
||||
position:
|
||||
top: 1
|
||||
left: 1
|
||||
height: 2
|
||||
width: 1
|
||||
refreshInterval: 15
|
@ -1,17 +0,0 @@
|
||||
wtf:
|
||||
grid:
|
||||
columns: [20, 20]
|
||||
rows: [3, 3]
|
||||
refreshInterval: 1
|
||||
mods:
|
||||
uptime:
|
||||
type: cmdrunner
|
||||
args: [""]
|
||||
cmd: "uptime"
|
||||
enabled: true
|
||||
position:
|
||||
top: 0
|
||||
left: 0
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 30
|
Binary file not shown.
Before Width: | Height: | Size: 210 KiB |
@ -1,26 +1,15 @@
|
||||
wtf:
|
||||
colors:
|
||||
background: black
|
||||
border:
|
||||
focusable: darkslateblue
|
||||
grid:
|
||||
columns: [40, 40]
|
||||
rows: [16]
|
||||
refreshInterval: 1
|
||||
mods:
|
||||
americas_time:
|
||||
title: "Americas"
|
||||
type: clocks
|
||||
clocks:
|
||||
enabled: true
|
||||
locations:
|
||||
Toronto: "America/Toronto"
|
||||
UTC: "Etc/UTC"
|
||||
Vancouver: "America/Vancouver"
|
||||
New_York: "America/New_York"
|
||||
Sao_Paolo: "America/Sao_Paulo"
|
||||
Denver: "America/Denver"
|
||||
Iqaluit: "America/Iqaluit"
|
||||
Bahamas: "America/Nassau"
|
||||
Chicago: "America/Chicago"
|
||||
position:
|
||||
top: 0
|
||||
left: 0
|
||||
@ -32,6 +21,7 @@ wtf:
|
||||
enabled: true
|
||||
filePaths:
|
||||
- "~/.config/wtf/config.yml"
|
||||
- "~/.config/wtf/log.txt"
|
||||
format: true
|
||||
formatStyle: "vim"
|
||||
position:
|
||||
|
@ -1,71 +0,0 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/olebedev/config"
|
||||
"github.com/rivo/tview"
|
||||
)
|
||||
|
||||
// WtfAppManager handles the instances of WtfApp, ensuring that they're displayed as requested
|
||||
type WtfAppManager struct {
|
||||
WtfApps []*WtfApp
|
||||
|
||||
selected int
|
||||
}
|
||||
|
||||
// NewAppManager creates and returns an instance of AppManager
|
||||
func NewAppManager() WtfAppManager {
|
||||
appMan := WtfAppManager{
|
||||
WtfApps: []*WtfApp{},
|
||||
}
|
||||
|
||||
return appMan
|
||||
}
|
||||
|
||||
// MakeNewWtfApp creates and starts a new instance of WtfApp from a set of configuration params
|
||||
func (appMan *WtfAppManager) MakeNewWtfApp(config *config.Config, configFilePath string) {
|
||||
wtfApp := NewWtfApp(tview.NewApplication(), config, configFilePath)
|
||||
appMan.Add(wtfApp)
|
||||
|
||||
wtfApp.Start()
|
||||
}
|
||||
|
||||
// Add adds a WtfApp to the collection of apps that the AppManager manages.
|
||||
// This app is then available for display onscreen.
|
||||
func (appMan *WtfAppManager) Add(wtfApp *WtfApp) {
|
||||
appMan.WtfApps = append(appMan.WtfApps, wtfApp)
|
||||
}
|
||||
|
||||
// Current returns the currently-displaying instance of WtfApp
|
||||
func (appMan *WtfAppManager) Current() (*WtfApp, error) {
|
||||
if appMan.selected < 0 || appMan.selected >= len(appMan.WtfApps) {
|
||||
return nil, errors.New("invalid app index selected")
|
||||
}
|
||||
|
||||
return appMan.WtfApps[appMan.selected], nil
|
||||
}
|
||||
|
||||
// Next cycles the WtfApps forward by one, making the next one in the list
|
||||
// the current one. If there are none after the current one, it wraps around.
|
||||
func (appMan *WtfAppManager) Next() (*WtfApp, error) {
|
||||
appMan.selected++
|
||||
|
||||
if appMan.selected >= len(appMan.WtfApps) {
|
||||
appMan.selected = 0
|
||||
}
|
||||
|
||||
return appMan.Current()
|
||||
}
|
||||
|
||||
// Prev cycles the WtfApps backwards by one, making the previous one in the
|
||||
// list the current one. If there are none before the current one, it wraps around.
|
||||
func (appMan *WtfAppManager) Prev() (*WtfApp, error) {
|
||||
appMan.selected--
|
||||
|
||||
if appMan.selected < 0 {
|
||||
appMan.selected = len(appMan.WtfApps) - 1
|
||||
}
|
||||
|
||||
return appMan.Current()
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"github.com/olebedev/config"
|
||||
"github.com/rivo/tview"
|
||||
"github.com/wtfutil/wtf/utils"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
// Display is the container for the onscreen representation of a WtfApp
|
||||
type Display struct {
|
||||
Grid *tview.Grid
|
||||
config *config.Config
|
||||
}
|
||||
|
||||
// NewDisplay creates and returns a Display
|
||||
func NewDisplay(widgets []wtf.Wtfable, config *config.Config) *Display {
|
||||
display := Display{
|
||||
Grid: tview.NewGrid(),
|
||||
config: config,
|
||||
}
|
||||
|
||||
firstWidget := widgets[0]
|
||||
display.Grid.SetBackgroundColor(
|
||||
wtf.ColorFor(
|
||||
firstWidget.CommonSettings().Colors.WidgetTheme.Background,
|
||||
),
|
||||
)
|
||||
|
||||
display.build(widgets)
|
||||
|
||||
return &display
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func (display *Display) add(widget wtf.Wtfable) {
|
||||
if widget.Disabled() {
|
||||
return
|
||||
}
|
||||
|
||||
display.Grid.AddItem(
|
||||
widget.TextView(),
|
||||
widget.CommonSettings().Top,
|
||||
widget.CommonSettings().Left,
|
||||
widget.CommonSettings().Height,
|
||||
widget.CommonSettings().Width,
|
||||
0,
|
||||
0,
|
||||
false,
|
||||
)
|
||||
}
|
||||
|
||||
func (display *Display) build(widgets []wtf.Wtfable) *tview.Grid {
|
||||
cols := utils.ToInts(display.config.UList("wtf.grid.columns"))
|
||||
rows := utils.ToInts(display.config.UList("wtf.grid.rows"))
|
||||
|
||||
display.Grid.SetColumns(cols...)
|
||||
display.Grid.SetRows(rows...)
|
||||
display.Grid.SetBorder(false)
|
||||
|
||||
for _, widget := range widgets {
|
||||
display.add(widget)
|
||||
}
|
||||
|
||||
return display.Grid
|
||||
}
|
@ -1,104 +0,0 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
"github.com/olebedev/config"
|
||||
)
|
||||
|
||||
const exitMessageHeader = `
|
||||
____ __ ____ .___________. _______
|
||||
\ \ / \ / / | || ____|
|
||||
\ \/ \/ / ----| |-----| |__
|
||||
\ / | | | __|
|
||||
\ /\ / | | | |
|
||||
\__/ \__/ |__| |__|
|
||||
|
||||
the personal information dashboard for your terminal
|
||||
`
|
||||
|
||||
// DisplayExitMessage displays the onscreen exit message when the app quits
|
||||
func (wtfApp *WtfApp) DisplayExitMessage() {
|
||||
exitMessageIsDisplayable := readDisplayableConfig(wtfApp.config)
|
||||
|
||||
wtfApp.displayExitMsg(exitMessageIsDisplayable)
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func (wtfApp *WtfApp) displayExitMsg(exitMessageIsDisplayable bool) string {
|
||||
// If a sponsor or contributor and opt out of seeing the exit message, do not display it
|
||||
if (wtfApp.ghUser.IsContributor || wtfApp.ghUser.IsSponsor) && !exitMessageIsDisplayable {
|
||||
return ""
|
||||
}
|
||||
|
||||
msgs := []string{}
|
||||
|
||||
msgs = append(msgs, aurora.Magenta(exitMessageHeader).String())
|
||||
|
||||
if wtfApp.ghUser.IsContributor {
|
||||
msgs = append(msgs, wtfApp.contributorThankYouMessage())
|
||||
}
|
||||
|
||||
if wtfApp.ghUser.IsSponsor {
|
||||
msgs = append(msgs, wtfApp.sponsorThankYouMessage())
|
||||
}
|
||||
|
||||
if !wtfApp.ghUser.IsContributor && !wtfApp.ghUser.IsSponsor {
|
||||
msgs = append(msgs, wtfApp.supportRequestMessage())
|
||||
}
|
||||
|
||||
displayMsg := strings.Join(msgs, "\n")
|
||||
|
||||
fmt.Println(displayMsg)
|
||||
|
||||
return displayMsg
|
||||
}
|
||||
|
||||
// readDisplayableConfig figures out whether or not the exit message should be displayed
|
||||
// per the user's wishes. It allows contributors and sponsors to opt out of the exit message
|
||||
func readDisplayableConfig(cfg *config.Config) bool {
|
||||
displayExitMsg := cfg.UBool("wtf.exitMessage.display", true)
|
||||
return displayExitMsg
|
||||
}
|
||||
|
||||
// readGitHubAPIKey attempts to find a GitHub API key somewhere in the configuration file
|
||||
func readGitHubAPIKey(cfg *config.Config) string {
|
||||
apiKey := cfg.UString("wtf.exitMessage.githubAPIKey", os.Getenv("WTF_GITHUB_TOKEN"))
|
||||
if apiKey != "" {
|
||||
return apiKey
|
||||
}
|
||||
|
||||
moduleConfig, err := cfg.Get("wtf.mods.github")
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return moduleConfig.UString("apiKey", "")
|
||||
}
|
||||
|
||||
/* -------------------- Messaging -------------------- */
|
||||
|
||||
func (wtfApp *WtfApp) contributorThankYouMessage() string {
|
||||
str := " On behalf of all the users of WTF, thank you for contributing to the source code."
|
||||
str += fmt.Sprintf(" %s", aurora.Green("\n\n You rock."))
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
func (wtfApp *WtfApp) sponsorThankYouMessage() string {
|
||||
str := " Your sponsorship of WTF makes a difference. Thank you for sponsoring and supporting WTF."
|
||||
str += fmt.Sprintf(" %s", aurora.Green("\n\n You're awesome."))
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
func (wtfApp *WtfApp) supportRequestMessage() string {
|
||||
str := " The development and maintenance of WTF is supported by sponsorships.\n"
|
||||
str += fmt.Sprintf(" Please consider sponsoring WTF at %s\n", aurora.Green("https://github.com/sponsors/senorprogrammer"))
|
||||
|
||||
return str
|
||||
}
|
@ -1,71 +0,0 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/wtfutil/wtf/support"
|
||||
"gotest.tools/assert"
|
||||
)
|
||||
|
||||
func Test_displayExitMessage(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
isDisplayable bool
|
||||
isContributor bool
|
||||
isSponsor bool
|
||||
compareWith string
|
||||
expected string
|
||||
}{
|
||||
{
|
||||
name: "when not displayable",
|
||||
isDisplayable: false,
|
||||
isContributor: true,
|
||||
isSponsor: true,
|
||||
compareWith: "equals",
|
||||
expected: "",
|
||||
},
|
||||
{
|
||||
name: "when contributor",
|
||||
isDisplayable: true,
|
||||
isContributor: true,
|
||||
compareWith: "contains",
|
||||
expected: "thank you for contributing",
|
||||
},
|
||||
{
|
||||
name: "when sponsor",
|
||||
isDisplayable: true,
|
||||
isSponsor: true,
|
||||
compareWith: "contains",
|
||||
expected: "Thank you for sponsoring",
|
||||
},
|
||||
{
|
||||
name: "when user",
|
||||
isDisplayable: true,
|
||||
isContributor: false,
|
||||
isSponsor: false,
|
||||
compareWith: "contains",
|
||||
expected: "supported by sponsorships",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
wtfApp := WtfApp{}
|
||||
wtfApp.ghUser = &support.GitHubUser{
|
||||
IsContributor: tt.isContributor,
|
||||
IsSponsor: tt.isSponsor,
|
||||
}
|
||||
|
||||
actual := wtfApp.displayExitMsg(tt.isDisplayable)
|
||||
|
||||
if tt.compareWith == "equals" {
|
||||
assert.Equal(t, actual, tt.expected)
|
||||
}
|
||||
|
||||
if tt.compareWith == "contains" {
|
||||
assert.Equal(t, true, strings.Contains(actual, tt.expected))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
"github.com/wtfutil/wtf/cfg"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
// ModuleValidator is responsible for validating the state of a module's configuration
|
||||
type ModuleValidator struct{}
|
||||
|
||||
type widgetError struct {
|
||||
name string
|
||||
validationErrors []cfg.Validatable
|
||||
}
|
||||
|
||||
// NewModuleValidator creates and returns an instance of ModuleValidator
|
||||
func NewModuleValidator() *ModuleValidator {
|
||||
return &ModuleValidator{}
|
||||
}
|
||||
|
||||
// Validate rolls through all the enabled widgets and looks for configuration errors.
|
||||
// If it finds any it stringifies them, writes them to the console, and kills the app gracefully
|
||||
func (val *ModuleValidator) Validate(widgets []wtf.Wtfable) {
|
||||
validationErrors := validate(widgets)
|
||||
|
||||
if len(validationErrors) > 0 {
|
||||
fmt.Println()
|
||||
for _, error := range validationErrors {
|
||||
for _, message := range error.errorMessages() {
|
||||
fmt.Println(message)
|
||||
}
|
||||
}
|
||||
fmt.Println()
|
||||
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func validate(widgets []wtf.Wtfable) (widgetErrors []widgetError) {
|
||||
for _, widget := range widgets {
|
||||
error := widgetError{name: widget.Name()}
|
||||
|
||||
for _, val := range widget.CommonSettings().Validations() {
|
||||
if val.HasError() {
|
||||
error.validationErrors = append(error.validationErrors, val)
|
||||
}
|
||||
}
|
||||
|
||||
if len(error.validationErrors) > 0 {
|
||||
widgetErrors = append(widgetErrors, error)
|
||||
}
|
||||
}
|
||||
|
||||
return widgetErrors
|
||||
}
|
||||
|
||||
func (err widgetError) errorMessages() (messages []string) {
|
||||
widgetMessage := fmt.Sprintf(
|
||||
"%s in %s configuration",
|
||||
aurora.Red("Errors"),
|
||||
aurora.Yellow(
|
||||
fmt.Sprintf(
|
||||
"%s.position",
|
||||
err.name,
|
||||
),
|
||||
),
|
||||
)
|
||||
messages = append(messages, widgetMessage)
|
||||
|
||||
for _, e := range err.validationErrors {
|
||||
configMessage := fmt.Sprintf(" - %s\t%s %v", e.String(), aurora.Red("Error:"), e.Error())
|
||||
|
||||
messages = append(messages, configMessage)
|
||||
}
|
||||
|
||||
return messages
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
"github.com/olebedev/config"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
const (
|
||||
valid = `
|
||||
wtf:
|
||||
mods:
|
||||
clocks:
|
||||
enabled: true
|
||||
position:
|
||||
top: 0
|
||||
left: 0
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 30`
|
||||
|
||||
invalid = `
|
||||
wtf:
|
||||
mods:
|
||||
clocks:
|
||||
enabled: true
|
||||
position:
|
||||
top: abc
|
||||
left: 0
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 30`
|
||||
)
|
||||
|
||||
func Test_NewModuleValidator(t *testing.T) {
|
||||
assert.IsType(t, &ModuleValidator{}, NewModuleValidator())
|
||||
}
|
||||
|
||||
func Test_validate(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
moduleName string
|
||||
config *config.Config
|
||||
expected []string
|
||||
}{
|
||||
{
|
||||
name: "valid config",
|
||||
moduleName: "clocks",
|
||||
config: func() *config.Config {
|
||||
cfg, _ := config.ParseYaml(valid)
|
||||
return cfg
|
||||
}(),
|
||||
expected: []string{},
|
||||
},
|
||||
{
|
||||
name: "invalid config",
|
||||
moduleName: "clocks",
|
||||
config: func() *config.Config {
|
||||
cfg, _ := config.ParseYaml(invalid)
|
||||
return cfg
|
||||
}(),
|
||||
expected: []string{
|
||||
fmt.Sprintf("%s in %s configuration", aurora.Red("Errors"), aurora.Yellow("clocks.position")),
|
||||
fmt.Sprintf(
|
||||
" - Invalid value for %s: 0 %s strconv.ParseInt: parsing \"abc\": invalid syntax",
|
||||
aurora.Yellow("top"),
|
||||
aurora.Red("Error:"),
|
||||
),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
widget := MakeWidget(nil, nil, tt.moduleName, tt.config)
|
||||
|
||||
if widget == nil {
|
||||
t.Logf("Failed to create widget %s", tt.moduleName)
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
errs := validate([]wtf.Wtfable{widget})
|
||||
|
||||
if len(tt.expected) == 0 {
|
||||
assert.Empty(t, errs)
|
||||
} else {
|
||||
assert.NotEmpty(t, errs)
|
||||
|
||||
var actual []string
|
||||
for _, err := range errs {
|
||||
actual = append(actual, err.errorMessages()...)
|
||||
}
|
||||
|
||||
assert.Equal(t, tt.expected, actual)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
// Schedule kicks off the first refresh of a module's data and then queues the rest of the
|
||||
// data refreshes on a timer
|
||||
func Schedule(widget wtf.Wtfable) {
|
||||
widget.Refresh()
|
||||
|
||||
interval := time.Duration(widget.RefreshInterval()) * time.Second
|
||||
|
||||
if interval <= 0 {
|
||||
return
|
||||
}
|
||||
|
||||
timer := time.NewTicker(interval)
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-timer.C:
|
||||
if widget.Enabled() {
|
||||
widget.Refresh()
|
||||
} else {
|
||||
timer.Stop()
|
||||
return
|
||||
}
|
||||
case quit := <-widget.QuitChan():
|
||||
if quit {
|
||||
timer.Stop()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,362 +0,0 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"github.com/olebedev/config"
|
||||
"github.com/rivo/tview"
|
||||
"github.com/wtfutil/wtf/modules/asana"
|
||||
"github.com/wtfutil/wtf/modules/azuredevops"
|
||||
"github.com/wtfutil/wtf/modules/bamboohr"
|
||||
"github.com/wtfutil/wtf/modules/bargraph"
|
||||
"github.com/wtfutil/wtf/modules/buildkite"
|
||||
cdsfavorites "github.com/wtfutil/wtf/modules/cds/favorites"
|
||||
cdsqueue "github.com/wtfutil/wtf/modules/cds/queue"
|
||||
cdsstatus "github.com/wtfutil/wtf/modules/cds/status"
|
||||
"github.com/wtfutil/wtf/modules/circleci"
|
||||
"github.com/wtfutil/wtf/modules/clocks"
|
||||
"github.com/wtfutil/wtf/modules/cmdrunner"
|
||||
"github.com/wtfutil/wtf/modules/covid"
|
||||
"github.com/wtfutil/wtf/modules/cryptoexchanges/bittrex"
|
||||
"github.com/wtfutil/wtf/modules/cryptoexchanges/blockfolio"
|
||||
"github.com/wtfutil/wtf/modules/cryptoexchanges/cryptolive"
|
||||
"github.com/wtfutil/wtf/modules/datadog"
|
||||
"github.com/wtfutil/wtf/modules/devto"
|
||||
"github.com/wtfutil/wtf/modules/digitalclock"
|
||||
"github.com/wtfutil/wtf/modules/digitalocean"
|
||||
"github.com/wtfutil/wtf/modules/docker"
|
||||
"github.com/wtfutil/wtf/modules/exchangerates"
|
||||
"github.com/wtfutil/wtf/modules/feedreader"
|
||||
"github.com/wtfutil/wtf/modules/football"
|
||||
"github.com/wtfutil/wtf/modules/gcal"
|
||||
"github.com/wtfutil/wtf/modules/gerrit"
|
||||
"github.com/wtfutil/wtf/modules/git"
|
||||
"github.com/wtfutil/wtf/modules/github"
|
||||
"github.com/wtfutil/wtf/modules/gitlab"
|
||||
"github.com/wtfutil/wtf/modules/gitlabtodo"
|
||||
"github.com/wtfutil/wtf/modules/gitter"
|
||||
"github.com/wtfutil/wtf/modules/googleanalytics"
|
||||
"github.com/wtfutil/wtf/modules/grafana"
|
||||
"github.com/wtfutil/wtf/modules/gspreadsheets"
|
||||
"github.com/wtfutil/wtf/modules/hackernews"
|
||||
"github.com/wtfutil/wtf/modules/healthchecks"
|
||||
"github.com/wtfutil/wtf/modules/hibp"
|
||||
"github.com/wtfutil/wtf/modules/ipaddresses/ipapi"
|
||||
"github.com/wtfutil/wtf/modules/ipaddresses/ipinfo"
|
||||
"github.com/wtfutil/wtf/modules/jenkins"
|
||||
"github.com/wtfutil/wtf/modules/jira"
|
||||
"github.com/wtfutil/wtf/modules/krisinformation"
|
||||
"github.com/wtfutil/wtf/modules/kubernetes"
|
||||
"github.com/wtfutil/wtf/modules/logger"
|
||||
"github.com/wtfutil/wtf/modules/mercurial"
|
||||
"github.com/wtfutil/wtf/modules/nbascore"
|
||||
"github.com/wtfutil/wtf/modules/newrelic"
|
||||
"github.com/wtfutil/wtf/modules/opsgenie"
|
||||
"github.com/wtfutil/wtf/modules/pagerduty"
|
||||
"github.com/wtfutil/wtf/modules/pihole"
|
||||
"github.com/wtfutil/wtf/modules/pocket"
|
||||
"github.com/wtfutil/wtf/modules/power"
|
||||
"github.com/wtfutil/wtf/modules/resourceusage"
|
||||
"github.com/wtfutil/wtf/modules/rollbar"
|
||||
"github.com/wtfutil/wtf/modules/security"
|
||||
"github.com/wtfutil/wtf/modules/spacex"
|
||||
"github.com/wtfutil/wtf/modules/spotify"
|
||||
"github.com/wtfutil/wtf/modules/spotifyweb"
|
||||
"github.com/wtfutil/wtf/modules/status"
|
||||
"github.com/wtfutil/wtf/modules/stocks/finnhub"
|
||||
"github.com/wtfutil/wtf/modules/stocks/yfinance"
|
||||
"github.com/wtfutil/wtf/modules/subreddit"
|
||||
"github.com/wtfutil/wtf/modules/textfile"
|
||||
"github.com/wtfutil/wtf/modules/todo"
|
||||
"github.com/wtfutil/wtf/modules/todo_plus"
|
||||
"github.com/wtfutil/wtf/modules/transmission"
|
||||
"github.com/wtfutil/wtf/modules/travisci"
|
||||
"github.com/wtfutil/wtf/modules/twitch"
|
||||
"github.com/wtfutil/wtf/modules/twitter"
|
||||
"github.com/wtfutil/wtf/modules/twitterstats"
|
||||
"github.com/wtfutil/wtf/modules/unknown"
|
||||
"github.com/wtfutil/wtf/modules/uptimerobot"
|
||||
"github.com/wtfutil/wtf/modules/victorops"
|
||||
"github.com/wtfutil/wtf/modules/weatherservices/arpansagovau"
|
||||
"github.com/wtfutil/wtf/modules/weatherservices/prettyweather"
|
||||
"github.com/wtfutil/wtf/modules/weatherservices/weather"
|
||||
"github.com/wtfutil/wtf/modules/zendesk"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
// MakeWidget creates and returns instances of widgets
|
||||
func MakeWidget(
|
||||
tviewApp *tview.Application,
|
||||
pages *tview.Pages,
|
||||
moduleName string,
|
||||
config *config.Config,
|
||||
) wtf.Wtfable {
|
||||
var widget wtf.Wtfable
|
||||
|
||||
moduleConfig, _ := config.Get("wtf.mods." + moduleName)
|
||||
|
||||
// Don' try to initialize modules that don't exist
|
||||
if moduleConfig == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Don't try to initialize modules that aren't enabled
|
||||
if enabled := moduleConfig.UBool("enabled", false); !enabled {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Always in alphabetical order
|
||||
switch moduleConfig.UString("type", moduleName) {
|
||||
case "arpansagovau":
|
||||
settings := arpansagovau.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = arpansagovau.NewWidget(tviewApp, settings)
|
||||
case "asana":
|
||||
settings := asana.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = asana.NewWidget(tviewApp, pages, settings)
|
||||
case "azuredevops":
|
||||
settings := azuredevops.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = azuredevops.NewWidget(tviewApp, pages, settings)
|
||||
case "bamboohr":
|
||||
settings := bamboohr.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = bamboohr.NewWidget(tviewApp, settings)
|
||||
case "bargraph":
|
||||
settings := bargraph.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = bargraph.NewWidget(tviewApp, settings)
|
||||
case "bittrex":
|
||||
settings := bittrex.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = bittrex.NewWidget(tviewApp, settings)
|
||||
case "blockfolio":
|
||||
settings := blockfolio.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = blockfolio.NewWidget(tviewApp, settings)
|
||||
case "buildkite":
|
||||
settings := buildkite.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = buildkite.NewWidget(tviewApp, pages, settings)
|
||||
case "cdsFavorites":
|
||||
settings := cdsfavorites.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = cdsfavorites.NewWidget(tviewApp, pages, settings)
|
||||
case "cdsQueue":
|
||||
settings := cdsqueue.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = cdsqueue.NewWidget(tviewApp, pages, settings)
|
||||
case "cdsStatus":
|
||||
settings := cdsstatus.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = cdsstatus.NewWidget(tviewApp, pages, settings)
|
||||
case "circleci":
|
||||
settings := circleci.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = circleci.NewWidget(tviewApp, settings)
|
||||
case "clocks":
|
||||
settings := clocks.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = clocks.NewWidget(tviewApp, settings)
|
||||
case "covid":
|
||||
settings := covid.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = covid.NewWidget(tviewApp, settings)
|
||||
case "cmdrunner":
|
||||
settings := cmdrunner.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = cmdrunner.NewWidget(tviewApp, settings)
|
||||
case "cryptolive":
|
||||
settings := cryptolive.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = cryptolive.NewWidget(tviewApp, settings)
|
||||
case "datadog":
|
||||
settings := datadog.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = datadog.NewWidget(tviewApp, pages, settings)
|
||||
case "devto":
|
||||
settings := devto.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = devto.NewWidget(tviewApp, pages, settings)
|
||||
case "digitalclock":
|
||||
settings := digitalclock.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = digitalclock.NewWidget(tviewApp, settings)
|
||||
case "digitalocean":
|
||||
settings := digitalocean.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = digitalocean.NewWidget(tviewApp, pages, settings)
|
||||
case "docker":
|
||||
settings := docker.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = docker.NewWidget(tviewApp, pages, settings)
|
||||
case "feedreader":
|
||||
settings := feedreader.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = feedreader.NewWidget(tviewApp, pages, settings)
|
||||
case "football":
|
||||
settings := football.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = football.NewWidget(tviewApp, pages, settings)
|
||||
case "gcal":
|
||||
settings := gcal.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = gcal.NewWidget(tviewApp, settings)
|
||||
case "gerrit":
|
||||
settings := gerrit.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = gerrit.NewWidget(tviewApp, pages, settings)
|
||||
case "git":
|
||||
settings := git.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = git.NewWidget(tviewApp, pages, settings)
|
||||
case "github":
|
||||
settings := github.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = github.NewWidget(tviewApp, pages, settings)
|
||||
case "gitlab":
|
||||
settings := gitlab.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = gitlab.NewWidget(tviewApp, pages, settings)
|
||||
case "gitlabtodo":
|
||||
settings := gitlabtodo.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = gitlabtodo.NewWidget(tviewApp, pages, settings)
|
||||
case "gitter":
|
||||
settings := gitter.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = gitter.NewWidget(tviewApp, pages, settings)
|
||||
case "googleanalytics":
|
||||
settings := googleanalytics.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = googleanalytics.NewWidget(tviewApp, settings)
|
||||
case "gspreadsheets":
|
||||
settings := gspreadsheets.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = gspreadsheets.NewWidget(tviewApp, settings)
|
||||
case "grafana":
|
||||
settings := grafana.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = grafana.NewWidget(tviewApp, pages, settings)
|
||||
case "hackernews":
|
||||
settings := hackernews.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = hackernews.NewWidget(tviewApp, pages, settings)
|
||||
case "healthchecks":
|
||||
settings := healthchecks.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = healthchecks.NewWidget(tviewApp, pages, settings)
|
||||
case "hibp":
|
||||
settings := hibp.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = hibp.NewWidget(tviewApp, settings)
|
||||
case "ipapi":
|
||||
settings := ipapi.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = ipapi.NewWidget(tviewApp, settings)
|
||||
case "ipinfo":
|
||||
settings := ipinfo.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = ipinfo.NewWidget(tviewApp, settings)
|
||||
case "jenkins":
|
||||
settings := jenkins.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = jenkins.NewWidget(tviewApp, pages, settings)
|
||||
case "jira":
|
||||
settings := jira.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = jira.NewWidget(tviewApp, pages, settings)
|
||||
case "kubernetes":
|
||||
settings := kubernetes.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = kubernetes.NewWidget(tviewApp, settings)
|
||||
case "krisinformation":
|
||||
settings := krisinformation.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = krisinformation.NewWidget(tviewApp, settings)
|
||||
case "logger":
|
||||
settings := logger.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = logger.NewWidget(tviewApp, settings)
|
||||
case "mercurial":
|
||||
settings := mercurial.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = mercurial.NewWidget(tviewApp, pages, settings)
|
||||
case "nbascore":
|
||||
settings := nbascore.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = nbascore.NewWidget(tviewApp, pages, settings)
|
||||
case "newrelic":
|
||||
settings := newrelic.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = newrelic.NewWidget(tviewApp, pages, settings)
|
||||
case "opsgenie":
|
||||
settings := opsgenie.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = opsgenie.NewWidget(tviewApp, settings)
|
||||
case "pagerduty":
|
||||
settings := pagerduty.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = pagerduty.NewWidget(tviewApp, settings)
|
||||
case "pihole":
|
||||
settings := pihole.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = pihole.NewWidget(tviewApp, pages, settings)
|
||||
case "power":
|
||||
settings := power.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = power.NewWidget(tviewApp, settings)
|
||||
case "prettyweather":
|
||||
settings := prettyweather.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = prettyweather.NewWidget(tviewApp, settings)
|
||||
case "pocket":
|
||||
settings := pocket.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = pocket.NewWidget(tviewApp, pages, settings)
|
||||
case "resourceusage":
|
||||
settings := resourceusage.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = resourceusage.NewWidget(tviewApp, settings)
|
||||
case "rollbar":
|
||||
settings := rollbar.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = rollbar.NewWidget(tviewApp, pages, settings)
|
||||
case "security":
|
||||
settings := security.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = security.NewWidget(tviewApp, settings)
|
||||
case "spacex":
|
||||
settings := spacex.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = spacex.NewWidget(tviewApp, settings)
|
||||
case "spotify":
|
||||
settings := spotify.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = spotify.NewWidget(tviewApp, pages, settings)
|
||||
case "spotifyweb":
|
||||
settings := spotifyweb.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = spotifyweb.NewWidget(tviewApp, pages, settings)
|
||||
case "status":
|
||||
settings := status.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = status.NewWidget(tviewApp, settings)
|
||||
case "subreddit":
|
||||
settings := subreddit.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = subreddit.NewWidget(tviewApp, pages, settings)
|
||||
case "textfile":
|
||||
settings := textfile.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = textfile.NewWidget(tviewApp, pages, settings)
|
||||
case "todo":
|
||||
settings := todo.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = todo.NewWidget(tviewApp, pages, settings)
|
||||
case "todo_plus":
|
||||
settings := todo_plus.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = todo_plus.NewWidget(tviewApp, pages, settings)
|
||||
case "todoist":
|
||||
settings := todo_plus.FromTodoist(moduleName, moduleConfig, config)
|
||||
widget = todo_plus.NewWidget(tviewApp, pages, settings)
|
||||
case "transmission":
|
||||
settings := transmission.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = transmission.NewWidget(tviewApp, pages, settings)
|
||||
case "travisci":
|
||||
settings := travisci.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = travisci.NewWidget(tviewApp, pages, settings)
|
||||
case "trello":
|
||||
settings := todo_plus.FromTrello(moduleName, moduleConfig, config)
|
||||
widget = todo_plus.NewWidget(tviewApp, pages, settings)
|
||||
case "twitch":
|
||||
settings := twitch.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = twitch.NewWidget(tviewApp, pages, settings)
|
||||
case "twitter":
|
||||
settings := twitter.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = twitter.NewWidget(tviewApp, pages, settings)
|
||||
case "twitterstats":
|
||||
settings := twitterstats.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = twitterstats.NewWidget(tviewApp, pages, settings)
|
||||
case "uptimerobot":
|
||||
settings := uptimerobot.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = uptimerobot.NewWidget(tviewApp, pages, settings)
|
||||
case "victorops":
|
||||
settings := victorops.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = victorops.NewWidget(tviewApp, settings)
|
||||
case "weather":
|
||||
settings := weather.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = weather.NewWidget(tviewApp, pages, settings)
|
||||
case "zendesk":
|
||||
settings := zendesk.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = zendesk.NewWidget(tviewApp, pages, settings)
|
||||
case "exchangerates":
|
||||
settings := exchangerates.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = exchangerates.NewWidget(tviewApp, pages, settings)
|
||||
case "finnhub":
|
||||
settings := finnhub.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = finnhub.NewWidget(tviewApp, settings)
|
||||
case "yfinance":
|
||||
settings := yfinance.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = yfinance.NewWidget(tviewApp, settings)
|
||||
default:
|
||||
settings := unknown.NewSettingsFromYAML(moduleName, moduleConfig, config)
|
||||
widget = unknown.NewWidget(tviewApp, settings)
|
||||
}
|
||||
|
||||
return widget
|
||||
}
|
||||
|
||||
// MakeWidgets creates and returns a collection of enabled widgets
|
||||
func MakeWidgets(tviewApp *tview.Application, pages *tview.Pages, config *config.Config) []wtf.Wtfable {
|
||||
widgets := []wtf.Wtfable{}
|
||||
|
||||
moduleNames, _ := config.Map("wtf.mods")
|
||||
|
||||
for moduleName := range moduleNames {
|
||||
widget := MakeWidget(tviewApp, pages, moduleName, config)
|
||||
|
||||
if widget != nil {
|
||||
widgets = append(widgets, widget)
|
||||
}
|
||||
}
|
||||
|
||||
return widgets
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/olebedev/config"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/wtfutil/wtf/modules/clocks"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
const (
|
||||
disabled = `
|
||||
wtf:
|
||||
mods:
|
||||
clocks:
|
||||
enabled: false
|
||||
position:
|
||||
top: 0
|
||||
left: 0
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 30`
|
||||
|
||||
enabled = `
|
||||
wtf:
|
||||
mods:
|
||||
clocks:
|
||||
enabled: true
|
||||
position:
|
||||
top: 0
|
||||
left: 0
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 30`
|
||||
)
|
||||
|
||||
func Test_MakeWidget(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
moduleName string
|
||||
config *config.Config
|
||||
expected wtf.Wtfable
|
||||
}{
|
||||
{
|
||||
name: "invalid module",
|
||||
moduleName: "",
|
||||
config: &config.Config{},
|
||||
expected: nil,
|
||||
},
|
||||
{
|
||||
name: "valid disabled module",
|
||||
moduleName: "clocks",
|
||||
config: func() *config.Config {
|
||||
cfg, _ := config.ParseYaml(disabled)
|
||||
return cfg
|
||||
}(),
|
||||
expected: nil,
|
||||
},
|
||||
{
|
||||
name: "valid enabled module",
|
||||
moduleName: "clocks",
|
||||
config: func() *config.Config {
|
||||
cfg, _ := config.ParseYaml(enabled)
|
||||
return cfg
|
||||
}(),
|
||||
expected: &clocks.Widget{},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
actual := MakeWidget(nil, nil, tt.moduleName, tt.config)
|
||||
assert.IsType(t, tt.expected, actual)
|
||||
})
|
||||
}
|
||||
}
|
201
app/wtf_app.go
201
app/wtf_app.go
@ -1,201 +0,0 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/gdamore/tcell"
|
||||
_ "github.com/gdamore/tcell/terminfo/extended"
|
||||
"github.com/logrusorgru/aurora"
|
||||
"github.com/olebedev/config"
|
||||
"github.com/radovskyb/watcher"
|
||||
"github.com/rivo/tview"
|
||||
"github.com/wtfutil/wtf/cfg"
|
||||
"github.com/wtfutil/wtf/support"
|
||||
"github.com/wtfutil/wtf/utils"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
// WtfApp is the container for a collection of widgets that are all constructed from a single
|
||||
// configuration file and displayed together
|
||||
type WtfApp struct {
|
||||
TViewApp *tview.Application
|
||||
|
||||
config *config.Config
|
||||
configFilePath string
|
||||
display *Display
|
||||
focusTracker FocusTracker
|
||||
ghUser *support.GitHubUser
|
||||
pages *tview.Pages
|
||||
validator *ModuleValidator
|
||||
widgets []wtf.Wtfable
|
||||
}
|
||||
|
||||
// NewWtfApp creates and returns an instance of WtfApp
|
||||
func NewWtfApp(tviewApp *tview.Application, config *config.Config, configFilePath string) *WtfApp {
|
||||
wtfApp := &WtfApp{
|
||||
TViewApp: tviewApp,
|
||||
|
||||
config: config,
|
||||
configFilePath: configFilePath,
|
||||
pages: tview.NewPages(),
|
||||
}
|
||||
|
||||
wtfApp.TViewApp.SetBeforeDrawFunc(func(s tcell.Screen) bool {
|
||||
s.Clear()
|
||||
return false
|
||||
})
|
||||
|
||||
wtfApp.widgets = MakeWidgets(wtfApp.TViewApp, wtfApp.pages, wtfApp.config)
|
||||
wtfApp.display = NewDisplay(wtfApp.widgets, wtfApp.config)
|
||||
wtfApp.focusTracker = NewFocusTracker(wtfApp.TViewApp, wtfApp.widgets, wtfApp.config)
|
||||
wtfApp.validator = NewModuleValidator()
|
||||
|
||||
githubAPIKey := readGitHubAPIKey(wtfApp.config)
|
||||
wtfApp.ghUser = support.NewGitHubUser(githubAPIKey)
|
||||
|
||||
wtfApp.pages.AddPage("grid", wtfApp.display.Grid, true, true)
|
||||
|
||||
wtfApp.validator.Validate(wtfApp.widgets)
|
||||
|
||||
firstWidget := wtfApp.widgets[0]
|
||||
wtfApp.pages.Box.SetBackgroundColor(
|
||||
wtf.ColorFor(
|
||||
firstWidget.CommonSettings().Colors.WidgetTheme.Background,
|
||||
),
|
||||
)
|
||||
|
||||
wtfApp.TViewApp.SetInputCapture(wtfApp.keyboardIntercept)
|
||||
wtfApp.TViewApp.SetRoot(wtfApp.pages, true)
|
||||
|
||||
return wtfApp
|
||||
}
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
// Run starts the underlying tview app
|
||||
func (wtfApp *WtfApp) Run() {
|
||||
if err := wtfApp.TViewApp.Run(); err != nil {
|
||||
fmt.Printf("\n%s %v\n", aurora.Red("ERROR"), err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
// Start initializes the app
|
||||
func (wtfApp *WtfApp) Start() {
|
||||
go wtfApp.scheduleWidgets()
|
||||
go wtfApp.watchForConfigChanges()
|
||||
|
||||
// FIXME: This should be moved to the AppManager
|
||||
go func() { _ = wtfApp.ghUser.Load() }()
|
||||
}
|
||||
|
||||
// Stop kills all the currently-running widgets in this app
|
||||
func (wtfApp *WtfApp) Stop() {
|
||||
wtfApp.stopAllWidgets()
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func (wtfApp *WtfApp) stopAllWidgets() {
|
||||
for _, widget := range wtfApp.widgets {
|
||||
widget.Stop()
|
||||
}
|
||||
}
|
||||
|
||||
func (wtfApp *WtfApp) keyboardIntercept(event *tcell.EventKey) *tcell.EventKey {
|
||||
// These keys are global keys used by the app. Widgets should not implement these keys
|
||||
switch event.Key() {
|
||||
case tcell.KeyCtrlC:
|
||||
wtfApp.Stop()
|
||||
wtfApp.TViewApp.Stop()
|
||||
wtfApp.DisplayExitMessage()
|
||||
case tcell.KeyCtrlR:
|
||||
wtfApp.refreshAllWidgets()
|
||||
return nil
|
||||
case tcell.KeyCtrlSpace:
|
||||
// FIXME: This can't reside in the app, the app doesn't know about
|
||||
// the AppManager. The AppManager needs to catch this one
|
||||
fmt.Println("Next app")
|
||||
return nil
|
||||
case tcell.KeyTab:
|
||||
wtfApp.focusTracker.Next()
|
||||
case tcell.KeyBacktab:
|
||||
wtfApp.focusTracker.Prev()
|
||||
return nil
|
||||
case tcell.KeyEsc:
|
||||
wtfApp.focusTracker.None()
|
||||
}
|
||||
|
||||
// Checks to see if any widget has been assigned the pressed key as its focus key
|
||||
if wtfApp.focusTracker.FocusOn(string(event.Rune())) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// If no specific widget has focus, then allow the key presses to fall through to the app
|
||||
if !wtfApp.focusTracker.IsFocused {
|
||||
switch string(event.Rune()) {
|
||||
case "/":
|
||||
return nil
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
return event
|
||||
}
|
||||
|
||||
func (wtfApp *WtfApp) refreshAllWidgets() {
|
||||
for _, widget := range wtfApp.widgets {
|
||||
go widget.Refresh()
|
||||
}
|
||||
}
|
||||
|
||||
func (wtfApp *WtfApp) scheduleWidgets() {
|
||||
for _, widget := range wtfApp.widgets {
|
||||
go Schedule(widget)
|
||||
}
|
||||
}
|
||||
|
||||
func (wtfApp *WtfApp) watchForConfigChanges() {
|
||||
watch := watcher.New()
|
||||
|
||||
// Notify write events
|
||||
watch.FilterOps(watcher.Write)
|
||||
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case <-watch.Event:
|
||||
wtfApp.Stop()
|
||||
|
||||
config := cfg.LoadWtfConfigFile(wtfApp.configFilePath)
|
||||
newApp := NewWtfApp(wtfApp.TViewApp, config, wtfApp.configFilePath)
|
||||
openURLUtil := utils.ToStrs(config.UList("wtf.openUrlUtil", []interface{}{}))
|
||||
utils.Init(config.UString("wtf.openFileUtil", "open"), openURLUtil)
|
||||
|
||||
newApp.Start()
|
||||
case err := <-watch.Error:
|
||||
if err == watcher.ErrWatchedFileDeleted {
|
||||
// Usually happens because the watcher looks for the file as the OS is updating it
|
||||
continue
|
||||
}
|
||||
log.Fatalln(err)
|
||||
case <-watch.Closed:
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
// Watch config file for changes.
|
||||
absPath, _ := utils.ExpandHomeDir(wtfApp.configFilePath)
|
||||
if err := watch.Add(absPath); err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
// Start the watching process - it'll check for changes every 100ms.
|
||||
if err := watch.Start(time.Millisecond * 100); err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
}
|
@ -3,6 +3,9 @@ package bamboohr
|
||||
import (
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
// A Client represents the data required to connect to the BambooHR API
|
||||
@ -13,13 +16,13 @@ type Client struct {
|
||||
}
|
||||
|
||||
// NewClient creates and returns a new BambooHR client
|
||||
func NewClient(url string, apiKey string, subdomain string) *Client {
|
||||
func NewClient(url string) *Client {
|
||||
client := Client{
|
||||
apiBase: url,
|
||||
apiKey: apiKey,
|
||||
subdomain: subdomain,
|
||||
apiBase: url,
|
||||
}
|
||||
|
||||
client.loadAPICredentials()
|
||||
|
||||
return &client
|
||||
}
|
||||
|
||||
@ -59,3 +62,15 @@ func (client *Client) away(startDate, endDate string) (cal Calendar, err error)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (client *Client) loadAPICredentials() {
|
||||
client.apiKey = wtf.Config.UString(
|
||||
"wtf.mods.bamboohr.apiKey",
|
||||
os.Getenv("WTF_BAMBOO_HR_TOKEN"),
|
||||
)
|
||||
|
||||
client.subdomain = wtf.Config.UString(
|
||||
"wtf.mods.bamboohr.subdomain",
|
||||
os.Getenv("WTF_BAMBOO_HR_SUBDOMAIN"),
|
||||
)
|
||||
}
|
@ -2,6 +2,7 @@ package bamboohr
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
//"time"
|
||||
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
@ -18,7 +18,7 @@ func Request(apiKey string, apiURL string) ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
defer resp.Body.Close()
|
||||
|
||||
data, err := ParseBody(resp)
|
||||
if err != nil {
|
62
bamboohr/widget.go
Normal file
62
bamboohr/widget.go
Normal file
@ -0,0 +1,62 @@
|
||||
package bamboohr
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/rivo/tview"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
type Widget struct {
|
||||
wtf.TextWidget
|
||||
}
|
||||
|
||||
func NewWidget(app *tview.Application) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(app, "BambooHR", "bamboohr", false),
|
||||
}
|
||||
|
||||
return &widget
|
||||
}
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
client := NewClient("https://api.bamboohr.com/api/gateway.php")
|
||||
todayItems := client.Away(
|
||||
"timeOff",
|
||||
wtf.Now().Format(wtf.DateFormat),
|
||||
wtf.Now().Format(wtf.DateFormat),
|
||||
)
|
||||
|
||||
widget.View.SetTitle(widget.ContextualTitle(widget.Name))
|
||||
|
||||
widget.View.SetText(widget.contentFrom(todayItems))
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) contentFrom(items []Item) string {
|
||||
if len(items) == 0 {
|
||||
return fmt.Sprintf("\n\n\n\n\n\n\n\n%s", wtf.CenterText("[grey]no one[white]", 50))
|
||||
}
|
||||
|
||||
str := ""
|
||||
for _, item := range items {
|
||||
str = str + widget.format(item)
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
func (widget *Widget) format(item Item) string {
|
||||
var str string
|
||||
|
||||
if item.IsOneDay() {
|
||||
str = fmt.Sprintf(" [green]%s[white]\n %s\n\n", item.Name(), item.PrettyEnd())
|
||||
} else {
|
||||
str = fmt.Sprintf(" [green]%s[white]\n %s - %s\n\n", item.Name(), item.PrettyStart(), item.PrettyEnd())
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
@ -5,27 +5,25 @@ This is a demo bargraph that just populates some random date/val data
|
||||
*/
|
||||
|
||||
import (
|
||||
"github.com/rivo/tview"
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
"github.com/rivo/tview"
|
||||
|
||||
"github.com/wtfutil/wtf/view"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
var started = false
|
||||
var ok = true
|
||||
|
||||
// Widget define wtf widget to register widget later
|
||||
type Widget struct {
|
||||
view.BarGraph
|
||||
|
||||
tviewApp *tview.Application
|
||||
wtf.BarGraph
|
||||
}
|
||||
|
||||
// NewWidget Make new instance of widget
|
||||
func NewWidget(tviewApp *tview.Application, settings *Settings) *Widget {
|
||||
func NewWidget(app *tview.Application) *Widget {
|
||||
widget := Widget{
|
||||
BarGraph: view.NewBarGraph(tviewApp, "Sample Bar Graph", settings.Common),
|
||||
|
||||
tviewApp: tviewApp,
|
||||
BarGraph: wtf.NewBarGraph(app, "Sample Bar Graph", "bargraph", false),
|
||||
}
|
||||
|
||||
widget.View.SetWrap(true)
|
||||
@ -41,16 +39,15 @@ func MakeGraph(widget *Widget) {
|
||||
|
||||
//this could come from config
|
||||
const lineCount = 8
|
||||
var stats [lineCount]view.Bar
|
||||
var stats [lineCount]wtf.Bar
|
||||
|
||||
barTime := time.Now()
|
||||
for i := 0; i < lineCount; i++ {
|
||||
barTime = barTime.Add(time.Minute)
|
||||
barTime = barTime.Add(time.Duration(time.Minute))
|
||||
|
||||
bar := view.Bar{
|
||||
Label: barTime.Format("15:04"),
|
||||
Percent: rand.Intn(100-5) + 5,
|
||||
LabelColor: "red",
|
||||
bar := wtf.Bar{
|
||||
Label: barTime.Format("15:04"),
|
||||
Percent: rand.Intn(100-5) + 5,
|
||||
}
|
||||
|
||||
stats[i] = bar
|
||||
@ -69,9 +66,7 @@ func (widget *Widget) Refresh() {
|
||||
|
||||
widget.View.Clear()
|
||||
|
||||
widget.tviewApp.QueueUpdateDraw(func() {
|
||||
display(widget)
|
||||
})
|
||||
display(widget)
|
||||
|
||||
}
|
||||
|
@ -1,214 +0,0 @@
|
||||
package cfg
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/olebedev/config"
|
||||
"golang.org/x/text/language"
|
||||
"golang.org/x/text/message"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultLanguageTag = "en-CA"
|
||||
)
|
||||
|
||||
type Module struct {
|
||||
Name string
|
||||
Type string
|
||||
}
|
||||
|
||||
type Sigils struct {
|
||||
Checkbox struct {
|
||||
Checked string
|
||||
Unchecked string
|
||||
}
|
||||
Paging struct {
|
||||
Normal string
|
||||
Selected string
|
||||
}
|
||||
}
|
||||
|
||||
// Common defines a set of common configuration settings applicable to all modules
|
||||
type Common struct {
|
||||
Module
|
||||
PositionSettings `help:"Defines where in the grid this module’s widget will be displayed."`
|
||||
Sigils
|
||||
|
||||
Colors ColorTheme
|
||||
Config *config.Config
|
||||
|
||||
DocPath string
|
||||
|
||||
Bordered bool `help:"Whether or not the module should be displayed with a border." values:"true, false" optional:"true" default:"true"`
|
||||
Enabled bool `help:"Whether or not this module is executed and if its data displayed onscreen." values:"true, false" optional:"true" default:"false"`
|
||||
Focusable bool `help:"Whether or not this module is focusable." values:"true, false" optional:"true" default:"false"`
|
||||
LanguageTag string `help:"The BCP 47 langauge tag to localize text to." values:"Any supported BCP 47 language tag." optional:"true" default:"en-CA"`
|
||||
RefreshInterval int `help:"How often, in seconds, this module will update its data." values:"A positive integer, 0..n." optional:"true"`
|
||||
Title string `help:"The title string to show when displaying this module" optional:"true"`
|
||||
|
||||
focusChar int `help:"Define one of the number keys as a short cut key to access the widget." optional:"true"`
|
||||
}
|
||||
|
||||
// NewCommonSettingsFromModule returns a common settings configuration tailed to the given module
|
||||
func NewCommonSettingsFromModule(name, defaultTitle string, defaultFocusable bool, moduleConfig *config.Config, globalConfig *config.Config) *Common {
|
||||
baseColors := NewDefaultColorTheme()
|
||||
|
||||
colorsConfig, err := globalConfig.Get("wtf.colors")
|
||||
if err != nil && strings.Contains(err.Error(), "Nonexistent map") {
|
||||
// Create a default colors config to fill in for the missing one
|
||||
// This comes into play when the configuration file does not contain a `colors:` key, i.e:
|
||||
//
|
||||
// wtf:
|
||||
// # colors: <- missing
|
||||
// refreshInterval: 1
|
||||
// openFileUtil: "open"
|
||||
//
|
||||
colorsConfig, _ = NewDefaultColorConfig()
|
||||
}
|
||||
|
||||
// And finally create a third instance to be the final default fallback in case there are empty or nil values in
|
||||
// the colors extracted from the config file (aka colorsConfig)
|
||||
defaultColorTheme := NewDefaultColorTheme()
|
||||
|
||||
baseColors.BorderTheme.Focusable = moduleConfig.UString("colors.border.focusable", colorsConfig.UString("border.focusable", defaultColorTheme.BorderTheme.Focusable))
|
||||
baseColors.BorderTheme.Focused = moduleConfig.UString("colors.border.focused", colorsConfig.UString("border.focused", defaultColorTheme.BorderTheme.Focused))
|
||||
baseColors.BorderTheme.Unfocusable = moduleConfig.UString("colors.border.normal", colorsConfig.UString("border.normal", defaultColorTheme.BorderTheme.Unfocusable))
|
||||
|
||||
baseColors.CheckboxTheme.Checked = moduleConfig.UString("colors.checked", colorsConfig.UString("checked", defaultColorTheme.CheckboxTheme.Checked))
|
||||
|
||||
baseColors.RowTheme.EvenForeground = moduleConfig.UString("colors.rows.even", colorsConfig.UString("rows.even", defaultColorTheme.RowTheme.EvenForeground))
|
||||
baseColors.RowTheme.OddForeground = moduleConfig.UString("colors.rows.odd", colorsConfig.UString("rows.odd", defaultColorTheme.RowTheme.OddForeground))
|
||||
|
||||
baseColors.TextTheme.Label = moduleConfig.UString("colors.label", colorsConfig.UString("label", defaultColorTheme.TextTheme.Label))
|
||||
baseColors.TextTheme.Subheading = moduleConfig.UString("colors.subheading", colorsConfig.UString("subheading", defaultColorTheme.TextTheme.Subheading))
|
||||
baseColors.TextTheme.Text = moduleConfig.UString("colors.text", colorsConfig.UString("text", defaultColorTheme.TextTheme.Text))
|
||||
baseColors.TextTheme.Title = moduleConfig.UString("colors.title", colorsConfig.UString("title", defaultColorTheme.TextTheme.Title))
|
||||
|
||||
baseColors.WidgetTheme.Background = moduleConfig.UString("colors.background", colorsConfig.UString("background", defaultColorTheme.WidgetTheme.Background))
|
||||
|
||||
common := Common{
|
||||
Colors: baseColors,
|
||||
|
||||
Module: Module{
|
||||
Name: name,
|
||||
Type: moduleConfig.UString("type", name),
|
||||
},
|
||||
|
||||
PositionSettings: NewPositionSettingsFromYAML(name, moduleConfig),
|
||||
|
||||
Bordered: moduleConfig.UBool("border", true),
|
||||
Config: moduleConfig,
|
||||
Enabled: moduleConfig.UBool("enabled", false),
|
||||
Focusable: moduleConfig.UBool("focusable", defaultFocusable),
|
||||
LanguageTag: globalConfig.UString("wtf.language", defaultLanguageTag),
|
||||
RefreshInterval: moduleConfig.UInt("refreshInterval", 300),
|
||||
Title: moduleConfig.UString("title", defaultTitle),
|
||||
|
||||
focusChar: moduleConfig.UInt("focusChar", -1),
|
||||
}
|
||||
|
||||
sigilsPath := "wtf.sigils"
|
||||
common.Sigils.Checkbox.Checked = globalConfig.UString(sigilsPath+".checkbox.checked", "x")
|
||||
common.Sigils.Checkbox.Unchecked = globalConfig.UString(sigilsPath+".checkbox.unchecked", " ")
|
||||
common.Sigils.Paging.Normal = globalConfig.UString(sigilsPath+".paging.normal", globalConfig.UString("wtf.paging.pageSigil", "*"))
|
||||
common.Sigils.Paging.Selected = globalConfig.UString(sigilsPath+".paging.select", globalConfig.UString("wtf.paging.selectedSigil", "_"))
|
||||
|
||||
return &common
|
||||
}
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
func (common *Common) DefaultFocusedRowColor() string {
|
||||
return fmt.Sprintf(
|
||||
"%s:%s",
|
||||
common.Colors.RowTheme.HighlightedForeground,
|
||||
common.Colors.RowTheme.HighlightedBackground,
|
||||
)
|
||||
}
|
||||
|
||||
func (common *Common) DefaultRowColor() string {
|
||||
return fmt.Sprintf(
|
||||
"%s:%s",
|
||||
common.Colors.RowTheme.EvenForeground,
|
||||
common.Colors.RowTheme.EvenBackground,
|
||||
)
|
||||
}
|
||||
|
||||
// FocusChar returns the keyboard number assigned to the widget used to give onscreen
|
||||
// focus to this widget, as a string. Focus characters can be a range between 1 and 9
|
||||
func (common *Common) FocusChar() string {
|
||||
if common.focusChar <= 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
if common.focusChar > 9 {
|
||||
return ""
|
||||
}
|
||||
|
||||
return fmt.Sprint(common.focusChar)
|
||||
}
|
||||
|
||||
// LocalizedPrinter returns a message.Printer instance localized to the BCP 47 language
|
||||
// configuration value defined in 'wtf.language' config. If none exists, it defaults to
|
||||
// 'en-CA'. Use this to format numbers, etc.
|
||||
func (common *Common) LocalizedPrinter() (*message.Printer, error) {
|
||||
langTag, err := language.Parse(common.LanguageTag)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prntr := message.NewPrinter(langTag)
|
||||
|
||||
return prntr, nil
|
||||
}
|
||||
|
||||
func (common *Common) RowColor(idx int) string {
|
||||
if idx%2 == 0 {
|
||||
return common.Colors.RowTheme.EvenForeground
|
||||
}
|
||||
|
||||
return common.Colors.RowTheme.OddForeground
|
||||
}
|
||||
|
||||
func (common *Common) RightAlignFormat(width int) string {
|
||||
borderOffset := 2
|
||||
return fmt.Sprintf("%%%ds", width-borderOffset)
|
||||
}
|
||||
|
||||
// PaginationMarker generates the pagination indicators that appear in the top-right corner
|
||||
// of multisource widgets
|
||||
func (common *Common) PaginationMarker(len, pos, width int) string {
|
||||
sigils := ""
|
||||
|
||||
if len > 1 {
|
||||
sigils = strings.Repeat(common.Sigils.Paging.Normal, pos)
|
||||
sigils += common.Sigils.Paging.Selected
|
||||
sigils += strings.Repeat(common.Sigils.Paging.Normal, len-1-pos)
|
||||
|
||||
sigils = "[lightblue]" + fmt.Sprintf(common.RightAlignFormat(width), sigils) + "[white]"
|
||||
}
|
||||
|
||||
return sigils
|
||||
}
|
||||
|
||||
// SetDocumentationPath is used to explicitly set the documentation path that should be opened
|
||||
// when the key to open the documentation is pressed.
|
||||
// Setting this is probably not necessary unless the module documentation is nested inside a
|
||||
// documentation subdirectory in the /wtfutildocs repo, or the module here has a different
|
||||
// name than the module's display name in the documentation (which ideally wouldn't be a thing).
|
||||
func (common *Common) SetDocumentationPath(path string) {
|
||||
common.DocPath = path
|
||||
}
|
||||
|
||||
// Validations aggregates all the validations from all the sub-sections in Common into a
|
||||
// single array of validations
|
||||
func (common *Common) Validations() []Validatable {
|
||||
validatables := []Validatable{}
|
||||
|
||||
for _, validation := range common.PositionSettings.Validations.validations {
|
||||
validatables = append(validatables, validation)
|
||||
}
|
||||
|
||||
return validatables
|
||||
}
|
@ -1,194 +0,0 @@
|
||||
package cfg
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/olebedev/config"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
var (
|
||||
testYaml = `
|
||||
wtf:
|
||||
colors:
|
||||
`
|
||||
|
||||
moduleConfig, _ = config.ParseYaml(testYaml)
|
||||
globalSettings, _ = config.ParseYaml(testYaml)
|
||||
|
||||
testCfg = NewCommonSettingsFromModule(
|
||||
"test",
|
||||
"Test Config",
|
||||
true,
|
||||
moduleConfig,
|
||||
globalSettings,
|
||||
)
|
||||
)
|
||||
|
||||
func Test_NewCommonSettingsFromModule(t *testing.T) {
|
||||
assert.Equal(t, true, testCfg.Bordered)
|
||||
assert.Equal(t, false, testCfg.Enabled)
|
||||
assert.Equal(t, true, testCfg.Focusable)
|
||||
assert.Equal(t, "test", testCfg.Module.Name)
|
||||
assert.Equal(t, "test", testCfg.Module.Type)
|
||||
assert.Equal(t, "", testCfg.FocusChar())
|
||||
assert.Equal(t, 300, testCfg.RefreshInterval)
|
||||
assert.Equal(t, "Test Config", testCfg.Title)
|
||||
}
|
||||
|
||||
func Test_DefaultFocusedRowColor(t *testing.T) {
|
||||
assert.Equal(t, "black:green", testCfg.DefaultFocusedRowColor())
|
||||
}
|
||||
|
||||
func Test_DefaultRowColor(t *testing.T) {
|
||||
assert.Equal(t, "white:transparent", testCfg.DefaultRowColor())
|
||||
}
|
||||
|
||||
func Test_FocusChar(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
before func(testCfg *Common)
|
||||
expectedChar string
|
||||
}{
|
||||
{
|
||||
name: "with negative focus char",
|
||||
before: func(testCfg *Common) {
|
||||
testCfg.focusChar = -1
|
||||
},
|
||||
expectedChar: "",
|
||||
},
|
||||
{
|
||||
name: "with positive focus char",
|
||||
before: func(testCfg *Common) {
|
||||
testCfg.focusChar = 3
|
||||
},
|
||||
expectedChar: "3",
|
||||
},
|
||||
{
|
||||
name: "with zero focus char",
|
||||
before: func(testCfg *Common) {
|
||||
testCfg.focusChar = 0
|
||||
},
|
||||
expectedChar: "",
|
||||
},
|
||||
{
|
||||
name: "with large focus char",
|
||||
before: func(testCfg *Common) {
|
||||
testCfg.focusChar = 10
|
||||
},
|
||||
expectedChar: "",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
tt.before(testCfg)
|
||||
|
||||
assert.Equal(t, tt.expectedChar, testCfg.FocusChar())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_RowColor(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
idx int
|
||||
expectedColor string
|
||||
}{
|
||||
{
|
||||
name: "odd rows, default",
|
||||
idx: 3,
|
||||
expectedColor: "lightblue",
|
||||
},
|
||||
{
|
||||
name: "even rows, default",
|
||||
idx: 8,
|
||||
expectedColor: "white",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
assert.Equal(t, tt.expectedColor, testCfg.RowColor(tt.idx))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_RightAlignFormat(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
width int
|
||||
expected string
|
||||
}{
|
||||
{
|
||||
name: "with zero",
|
||||
width: 0,
|
||||
expected: "%-2s",
|
||||
},
|
||||
{
|
||||
name: "with positive integer",
|
||||
width: 3,
|
||||
expected: "%1s",
|
||||
},
|
||||
{
|
||||
name: "with negative integer",
|
||||
width: -3,
|
||||
expected: "%-5s",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
assert.Equal(t, tt.expected, testCfg.RightAlignFormat(tt.width))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_PaginationMarker(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
len int
|
||||
pos int
|
||||
width int
|
||||
expected string
|
||||
}{
|
||||
{
|
||||
name: "with zero pages",
|
||||
len: 0,
|
||||
pos: 1,
|
||||
width: 5,
|
||||
expected: "",
|
||||
},
|
||||
{
|
||||
name: "with one page",
|
||||
len: 1,
|
||||
pos: 1,
|
||||
width: 5,
|
||||
expected: "",
|
||||
},
|
||||
{
|
||||
name: "with multiple pages",
|
||||
len: 3,
|
||||
pos: 1,
|
||||
width: 5,
|
||||
expected: "[lightblue]*_*[white]",
|
||||
},
|
||||
{
|
||||
name: "with negative pages",
|
||||
len: -3,
|
||||
pos: 1,
|
||||
width: 5,
|
||||
expected: "",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
assert.Equal(t, tt.expected, testCfg.PaginationMarker(tt.len, tt.pos, tt.width))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_Validations(t *testing.T) {
|
||||
assert.Equal(t, 4, len(testCfg.Validations()))
|
||||
}
|
@ -1,43 +1,109 @@
|
||||
package cfg
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/olebedev/config"
|
||||
"github.com/wtfutil/wtf/logger"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
const (
|
||||
// XdgConfigDir defines the path to the minimal XDG-compatible configuration directory
|
||||
XdgConfigDir = "~/.config/"
|
||||
// ConfigDirV1 defines the path to the first version of configuration. Do not use this
|
||||
const ConfigDirV1 = "~/.wtf/"
|
||||
|
||||
// WtfConfigDirV1 defines the path to the first version of configuration. Do not use this
|
||||
WtfConfigDirV1 = "~/.wtf/"
|
||||
// ConfigDirV2 defines the path to the second version of the configuration. Use this.
|
||||
const ConfigDirV2 = "~/.config/wtf/"
|
||||
|
||||
// WtfConfigDirV2 defines the path to the second version of the configuration. Use this.
|
||||
WtfConfigDirV2 = "~/.config/wtf/"
|
||||
/* -------------------- Config Migration -------------------- */
|
||||
|
||||
// WtfConfigFile defines the name of the default config file
|
||||
WtfConfigFile = "config.yml"
|
||||
)
|
||||
// MigrateOldConfig copies any existing configuration from the old location
|
||||
// to the new, XDG-compatible location
|
||||
func MigrateOldConfig() {
|
||||
srcDir, _ := wtf.ExpandHomeDir(ConfigDirV1)
|
||||
destDir, _ := wtf.ExpandHomeDir(ConfigDirV2)
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
// If the old config directory doesn't exist, do not move
|
||||
if _, err := os.Stat(srcDir); os.IsNotExist(err) {
|
||||
return
|
||||
}
|
||||
|
||||
// CreateFile creates the named file in the config directory, if it does not already exist.
|
||||
// If the file exists it does not recreate it.
|
||||
// If successful, returns the absolute path to the file
|
||||
// If unsuccessful, returns an error
|
||||
func CreateFile(fileName string) (string, error) {
|
||||
configDir, err := WtfConfigDir()
|
||||
// If the new config directory already exists, do not move
|
||||
if _, err := os.Stat(destDir); err == nil {
|
||||
return
|
||||
}
|
||||
|
||||
// Time to move
|
||||
err := Copy(srcDir, destDir)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
} else {
|
||||
logger.Log(fmt.Sprintf("Copied old config from %s to %s", srcDir, destDir))
|
||||
}
|
||||
|
||||
// Delete the old directory if the new one exists
|
||||
if _, err := os.Stat(destDir); err == nil {
|
||||
err := os.RemoveAll(srcDir)
|
||||
if err != nil {
|
||||
logger.Log(err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------- Config Migration -------------------- */
|
||||
|
||||
// ConfigDir returns the absolute path to the configuration directory
|
||||
func ConfigDir() (string, error) {
|
||||
configDir, err := wtf.ExpandHomeDir(ConfigDirV2)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
filePath := filepath.Join(configDir, fileName)
|
||||
return configDir, nil
|
||||
}
|
||||
|
||||
// CreateConfigDir creates the wtf/ directory in the user's home dir
|
||||
func CreateConfigDir() {
|
||||
configDir, _ := ConfigDir()
|
||||
|
||||
if _, err := os.Stat(configDir); os.IsNotExist(err) {
|
||||
err := os.Mkdir(configDir, os.ModePerm)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CreateConfigFile creates a simple config file in the config directory if
|
||||
// one does not already exist
|
||||
func CreateConfigFile() {
|
||||
filePath, err := CreateFile("config.yml")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// If the file is empty, write to it
|
||||
file, _ := os.Stat(filePath)
|
||||
|
||||
if file.Size() == 0 {
|
||||
if ioutil.WriteFile(filePath, []byte(simpleConfig), 0644) != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CreateFile creates the named file in the config directory, if it does not already exist.
|
||||
// If the file exists it does not recreate it.
|
||||
// If successful, eturns the absolute path to the file
|
||||
// If unsuccessful, returns an error
|
||||
func CreateFile(fileName string) (string, error) {
|
||||
configDir, err := ConfigDir()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
filePath := fmt.Sprintf("%s/%s", configDir, fileName)
|
||||
|
||||
// Check if the file already exists; if it does not, create it
|
||||
_, err = os.Stat(filePath)
|
||||
@ -55,170 +121,81 @@ func CreateFile(fileName string) (string, error) {
|
||||
return filePath, nil
|
||||
}
|
||||
|
||||
// Initialize takes care of settings up the initial state of WTF configuration
|
||||
// It ensures necessary directories and files exist
|
||||
func Initialize(hasCustom bool) {
|
||||
if !hasCustom {
|
||||
migrateOldConfig()
|
||||
}
|
||||
|
||||
// These always get created because this is where modules should write any permanent
|
||||
// data they need to persist between runs (i.e.: log, textfile, etc.)
|
||||
createWtfConfigDir()
|
||||
|
||||
if !hasCustom {
|
||||
createWtfConfigFile()
|
||||
chmodConfigFile()
|
||||
}
|
||||
}
|
||||
|
||||
// WtfConfigDir returns the absolute path to the configuration directory
|
||||
func WtfConfigDir() (string, error) {
|
||||
configDir := os.Getenv("XDG_CONFIG_HOME")
|
||||
if configDir == "" {
|
||||
configDir = WtfConfigDirV2
|
||||
} else {
|
||||
configDir += "/wtf/"
|
||||
}
|
||||
configDir, err := expandHomeDir(configDir)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return configDir, nil
|
||||
}
|
||||
|
||||
// LoadWtfConfigFile loads the specified config file
|
||||
func LoadWtfConfigFile(filePath string) *config.Config {
|
||||
absPath, _ := expandHomeDir(filePath)
|
||||
// LoadConfigFile loads the config.yml file to configure the app
|
||||
func LoadConfigFile(filePath string) *config.Config {
|
||||
absPath, _ := wtf.ExpandHomeDir(filePath)
|
||||
|
||||
cfg, err := config.ParseYamlFile(absPath)
|
||||
if err != nil {
|
||||
displayWtfConfigFileLoadError(absPath, err)
|
||||
fmt.Println("\n\n\033[1m ERROR:\033[0m Could not load '\033[0;33mconfig.yml\033[0m'.\n Please add a \033[0;33mconfig.yml\033[0m file to your \033[0;33m~/.config/wtf\033[0m directory.\n See \033[1;34mhttps://github.com/wtfutil/wtf\033[0m for details.")
|
||||
fmt.Printf(" %s\n", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
return cfg
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
// chmodConfigFile sets the mode of the config file to r+w for the owner only
|
||||
func chmodConfigFile() {
|
||||
configDir, _ := WtfConfigDir()
|
||||
relPath := filepath.Join(configDir, WtfConfigFile)
|
||||
absPath, _ := expandHomeDir(relPath)
|
||||
|
||||
_, err := os.Stat(absPath)
|
||||
if err != nil && os.IsNotExist(err) {
|
||||
return
|
||||
}
|
||||
|
||||
err = os.Chmod(absPath, 0600)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// createWtfConfigDir creates the necessary directories for storing the default config file
|
||||
// If ~/.config/wtf is missing, it will try to create it
|
||||
func createWtfConfigDir() {
|
||||
wtfConfigDir, _ := WtfConfigDir()
|
||||
|
||||
if _, err := os.Stat(wtfConfigDir); os.IsNotExist(err) {
|
||||
err := os.MkdirAll(wtfConfigDir, os.ModePerm)
|
||||
if err != nil {
|
||||
displayWtfConfigDirCreateError(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// createWtfConfigFile creates a simple config file in the config directory if
|
||||
// one does not already exist
|
||||
func createWtfConfigFile() {
|
||||
filePath, err := CreateFile(WtfConfigFile)
|
||||
if err != nil {
|
||||
displayDefaultConfigCreateError(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// If the file is empty, write to it
|
||||
file, _ := os.Stat(filePath)
|
||||
|
||||
if file.Size() == 0 {
|
||||
if ioutil.WriteFile(filePath, []byte(defaultConfigFile), 0600) != nil {
|
||||
displayDefaultConfigWriteError(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Expand expands the path to include the home directory if the path
|
||||
// is prefixed with `~`. If it isn't prefixed with `~`, the path is
|
||||
// returned as-is.
|
||||
func expandHomeDir(path string) (string, error) {
|
||||
if len(path) == 0 {
|
||||
return path, nil
|
||||
}
|
||||
|
||||
if path[0] != '~' {
|
||||
return path, nil
|
||||
}
|
||||
|
||||
if len(path) > 1 && path[1] != '/' && path[1] != '\\' {
|
||||
return "", errors.New("cannot expand user-specific home dir")
|
||||
}
|
||||
|
||||
dir, err := home()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return filepath.Join(dir, path[1:]), nil
|
||||
}
|
||||
|
||||
// Dir returns the home directory for the executing user.
|
||||
// An error is returned if a home directory cannot be detected.
|
||||
func home() (string, error) {
|
||||
currentUser, err := user.Current()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if currentUser.HomeDir == "" {
|
||||
return "", errors.New("cannot find user-specific home dir")
|
||||
}
|
||||
|
||||
return currentUser.HomeDir, nil
|
||||
}
|
||||
|
||||
// migrateOldConfig copies any existing configuration from the old location
|
||||
// to the new, XDG-compatible location
|
||||
func migrateOldConfig() {
|
||||
srcDir, _ := expandHomeDir(WtfConfigDirV1)
|
||||
destDir, _ := WtfConfigDir()
|
||||
|
||||
// If the old config directory doesn't exist, do not move
|
||||
if _, err := os.Stat(srcDir); os.IsNotExist(err) {
|
||||
return
|
||||
}
|
||||
|
||||
// If the new config directory already exists, do not move
|
||||
if _, err := os.Stat(destDir); err == nil {
|
||||
return
|
||||
}
|
||||
|
||||
// Time to move
|
||||
err := Copy(srcDir, destDir)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Delete the old directory if the new one exists
|
||||
if _, err := os.Stat(destDir); err == nil {
|
||||
err := os.RemoveAll(srcDir)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
const simpleConfig = `wtf:
|
||||
colors:
|
||||
border:
|
||||
focusable: darkslateblue
|
||||
focused: orange
|
||||
normal: gray
|
||||
grid:
|
||||
columns: [40, 40]
|
||||
rows: [13, 13, 4]
|
||||
refreshInterval: 1
|
||||
mods:
|
||||
clocks:
|
||||
colors:
|
||||
rows:
|
||||
even: "lightblue"
|
||||
odd: "white"
|
||||
enabled: true
|
||||
locations:
|
||||
Avignon: "Europe/Paris"
|
||||
Barcelona: "Europe/Madrid"
|
||||
Dubai: "Asia/Dubai"
|
||||
Vancouver: "America/Vancouver"
|
||||
Toronto: "America/Toronto"
|
||||
position:
|
||||
top: 0
|
||||
left: 0
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 15
|
||||
sort: "alphabetical"
|
||||
security:
|
||||
enabled: true
|
||||
position:
|
||||
top: 1
|
||||
left: 0
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 3600
|
||||
status:
|
||||
enabled: true
|
||||
position:
|
||||
top: 2
|
||||
left: 0
|
||||
height: 1
|
||||
width: 2
|
||||
refreshInterval: 1
|
||||
system:
|
||||
enabled: true
|
||||
position:
|
||||
top: 0
|
||||
left: 1
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 3600
|
||||
textfile:
|
||||
enabled: true
|
||||
filePath: "~/.config/wtf/config.yml"
|
||||
position:
|
||||
top: 1
|
||||
left: 1
|
||||
height: 1
|
||||
width: 1
|
||||
refreshInterval: 30
|
||||
`
|
||||
|
@ -34,17 +34,17 @@ func fcopy(src, dest string, info os.FileInfo) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() { _ = f.Close() }()
|
||||
defer f.Close()
|
||||
|
||||
if err = os.Chmod(f.Name(), info.Mode()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
s, err := os.Open(filepath.Clean(src))
|
||||
s, err := os.Open(src)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() { _ = f.Close() }()
|
||||
defer s.Close()
|
||||
|
||||
_, err = io.Copy(f, s)
|
||||
return err
|
||||
|
@ -1,109 +0,0 @@
|
||||
package cfg
|
||||
|
||||
import (
|
||||
"github.com/olebedev/config"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
// BorderTheme defines the default color scheme for drawing widget borders
|
||||
type BorderTheme struct {
|
||||
Focusable string
|
||||
Focused string
|
||||
Unfocusable string
|
||||
}
|
||||
|
||||
// CheckboxTheme defines the default color scheme for drawing checkable rows in widgets
|
||||
type CheckboxTheme struct {
|
||||
Checked string
|
||||
}
|
||||
|
||||
// RowTheme defines the default color scheme for row text
|
||||
type RowTheme struct {
|
||||
EvenBackground string
|
||||
EvenForeground string
|
||||
|
||||
OddBackground string
|
||||
OddForeground string
|
||||
|
||||
HighlightedBackground string
|
||||
HighlightedForeground string
|
||||
}
|
||||
|
||||
// TextTheme defines the default color scheme for text rendering
|
||||
type TextTheme struct {
|
||||
Label string
|
||||
Subheading string
|
||||
Text string
|
||||
Title string
|
||||
}
|
||||
|
||||
// WidgetTheme defines the default color scheme for the widget rect itself
|
||||
type WidgetTheme struct {
|
||||
Background string
|
||||
}
|
||||
|
||||
// ColorTheme is an alamgam of all the default color settings
|
||||
type ColorTheme struct {
|
||||
BorderTheme
|
||||
CheckboxTheme
|
||||
RowTheme
|
||||
TextTheme
|
||||
WidgetTheme
|
||||
}
|
||||
|
||||
// NewDefaultColorTheme creates and returns an instance of DefaultColorTheme
|
||||
func NewDefaultColorTheme() ColorTheme {
|
||||
defaultTheme := ColorTheme{
|
||||
BorderTheme: BorderTheme{
|
||||
Focusable: "blue",
|
||||
Focused: "orange",
|
||||
Unfocusable: "gray",
|
||||
},
|
||||
|
||||
CheckboxTheme: CheckboxTheme{
|
||||
Checked: "gray",
|
||||
},
|
||||
|
||||
RowTheme: RowTheme{
|
||||
EvenBackground: "transparent",
|
||||
EvenForeground: "white",
|
||||
|
||||
OddBackground: "transparent",
|
||||
OddForeground: "lightblue",
|
||||
|
||||
HighlightedForeground: "black",
|
||||
HighlightedBackground: "green",
|
||||
},
|
||||
|
||||
TextTheme: TextTheme{
|
||||
Label: "lightblue",
|
||||
Subheading: "red",
|
||||
Text: "white",
|
||||
Title: "green",
|
||||
},
|
||||
|
||||
WidgetTheme: WidgetTheme{
|
||||
Background: "transparent",
|
||||
},
|
||||
}
|
||||
|
||||
return defaultTheme
|
||||
}
|
||||
|
||||
// NewDefaultColorConfig creates and returns a config.Config-compatible configuration struct
|
||||
// using a DefaultColorTheme to pre-populate all the relevant values
|
||||
func NewDefaultColorConfig() (*config.Config, error) {
|
||||
colorTheme := NewDefaultColorTheme()
|
||||
|
||||
yamlBytes, err := yaml.Marshal(colorTheme)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cfg, err := config.ParseYamlBytes(yamlBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return cfg, nil
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package cfg
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_NewDefaultColorTheme(t *testing.T) {
|
||||
theme := NewDefaultColorTheme()
|
||||
|
||||
assert.Equal(t, "orange", theme.BorderTheme.Focused)
|
||||
assert.Equal(t, "red", theme.TextTheme.Subheading)
|
||||
assert.Equal(t, "transparent", theme.WidgetTheme.Background)
|
||||
}
|
||||
|
||||
func Test_NewDefaultColorConfig(t *testing.T) {
|
||||
cfg, err := NewDefaultColorConfig()
|
||||
|
||||
assert.Nil(t, err)
|
||||
|
||||
assert.Equal(t, "orange", cfg.UString("bordertheme.focused"))
|
||||
assert.Equal(t, "red", cfg.UString("texttheme.subheading"))
|
||||
assert.Equal(t, "transparent", cfg.UString("widgettheme.background"))
|
||||
assert.Equal(t, "", cfg.UString("widgettheme.missing"))
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
package cfg
|
||||
|
||||
// This file contains the error messages that get written to the terminal when
|
||||
// something goes wrong with the configuration process.
|
||||
//
|
||||
// As a general rule, if one of these has to be shown the app should then die
|
||||
// via os.Exit(1)
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
)
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func displayError(err error) {
|
||||
fmt.Printf("%s %s\n\n", aurora.Red("Error:"), err.Error())
|
||||
}
|
||||
|
||||
func displayDefaultConfigCreateError(err error) {
|
||||
fmt.Printf("\n%s Could not create the default configuration file.\n", aurora.Red("ERROR"))
|
||||
fmt.Println()
|
||||
displayError(err)
|
||||
}
|
||||
|
||||
func displayDefaultConfigWriteError(err error) {
|
||||
fmt.Printf("\n%s Could not write the default configuration file.\n", aurora.Red("ERROR"))
|
||||
fmt.Println()
|
||||
displayError(err)
|
||||
}
|
||||
|
||||
func displayWtfConfigDirCreateError(err error) {
|
||||
fmt.Printf("\n%s Could not create the '%s' directory.\n", aurora.Red("ERROR"), aurora.Yellow(WtfConfigDirV2))
|
||||
fmt.Println()
|
||||
displayError(err)
|
||||
}
|
||||
|
||||
func displayWtfConfigFileLoadError(path string, err error) {
|
||||
fmt.Printf("\n%s Could not load '%s'.\n", aurora.Red("ERROR"), aurora.Yellow(path))
|
||||
fmt.Println()
|
||||
fmt.Println("This could mean one of two things:")
|
||||
fmt.Println()
|
||||
fmt.Println(" 1. That file doesn't exist.")
|
||||
fmt.Println(" 2. That file has a YAML syntax error. Try running it through http://www.yamllint.com to check for errors.")
|
||||
fmt.Println()
|
||||
displayError(err)
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
package cfg
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/olebedev/config"
|
||||
)
|
||||
|
||||
// ParseAsMapOrList takes a configuration key and attempts to parse it first as a map
|
||||
// and then as a list. Map entries are concatenated as "key/value"
|
||||
func ParseAsMapOrList(ymlConfig *config.Config, configKey string) []string {
|
||||
result := []string{}
|
||||
|
||||
mapItems, err := ymlConfig.Map(configKey)
|
||||
if err == nil {
|
||||
for key, value := range mapItems {
|
||||
result = append(result, fmt.Sprintf("%s/%s", value, key))
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
listItems := ymlConfig.UList(configKey)
|
||||
for _, listItem := range listItems {
|
||||
result = append(result, listItem.(string))
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
package cfg
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/olebedev/config"
|
||||
)
|
||||
|
||||
func Test_ParseAsMapOrList(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
configKey string
|
||||
yaml string
|
||||
expectedCount int
|
||||
}{
|
||||
{
|
||||
name: "as empty set",
|
||||
configKey: "data",
|
||||
yaml: "",
|
||||
expectedCount: 0,
|
||||
},
|
||||
{
|
||||
name: "as map",
|
||||
configKey: "data",
|
||||
yaml: "data:\n a: cat\n b: dog",
|
||||
expectedCount: 2,
|
||||
},
|
||||
{
|
||||
name: "as list",
|
||||
configKey: "data",
|
||||
yaml: "data:\n - cat\n - dog\n - rat\n",
|
||||
expectedCount: 3,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
ymlConfig, err := config.ParseYaml(tt.yaml)
|
||||
if err != nil {
|
||||
t.Errorf("\nexpected: no error\n got: %v", err)
|
||||
}
|
||||
|
||||
actual := ParseAsMapOrList(ymlConfig, tt.configKey)
|
||||
|
||||
if tt.expectedCount != len(actual) {
|
||||
t.Errorf("\nexpected: %d\n got: %d", tt.expectedCount, len(actual))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
package cfg
|
||||
|
||||
import (
|
||||
"github.com/olebedev/config"
|
||||
)
|
||||
|
||||
const (
|
||||
positionPath = "position"
|
||||
)
|
||||
|
||||
// PositionSettings represents the onscreen location of a widget
|
||||
type PositionSettings struct {
|
||||
Validations *Validations
|
||||
|
||||
Height int
|
||||
Left int
|
||||
Top int
|
||||
Width int
|
||||
}
|
||||
|
||||
// NewPositionSettingsFromYAML creates and returns a new instance of cfg.Position
|
||||
func NewPositionSettingsFromYAML(moduleName string, moduleConfig *config.Config) PositionSettings {
|
||||
var currVal int
|
||||
var err error
|
||||
|
||||
validations := NewValidations()
|
||||
|
||||
// Parse the positional data from the config data
|
||||
currVal, err = moduleConfig.Int(positionPath + ".top")
|
||||
validations.append("top", newPositionValidation("top", currVal, err))
|
||||
|
||||
currVal, err = moduleConfig.Int(positionPath + ".left")
|
||||
validations.append("left", newPositionValidation("left", currVal, err))
|
||||
|
||||
currVal, err = moduleConfig.Int(positionPath + ".width")
|
||||
validations.append("width", newPositionValidation("width", currVal, err))
|
||||
|
||||
currVal, err = moduleConfig.Int(positionPath + ".height")
|
||||
validations.append("height", newPositionValidation("height", currVal, err))
|
||||
|
||||
pos := PositionSettings{
|
||||
Validations: validations,
|
||||
|
||||
Top: validations.intValueFor("top"),
|
||||
Left: validations.intValueFor("left"),
|
||||
Width: validations.intValueFor("width"),
|
||||
Height: validations.intValueFor("height"),
|
||||
}
|
||||
|
||||
return pos
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
package cfg
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
)
|
||||
|
||||
// Common examples of invalid position configuration are:
|
||||
//
|
||||
// position:
|
||||
// top: -3
|
||||
// left: 2
|
||||
// width: 0
|
||||
// height: 1
|
||||
//
|
||||
// position:
|
||||
// top: 3
|
||||
// width: 2
|
||||
// height: 1
|
||||
//
|
||||
// position:
|
||||
// top: 3
|
||||
// # left: 2
|
||||
// width: 2
|
||||
// height: 1
|
||||
//
|
||||
// position:
|
||||
// top: 3
|
||||
// left: 2
|
||||
// width: 2
|
||||
// height: 1
|
||||
//
|
||||
type positionValidation struct {
|
||||
err error
|
||||
name string
|
||||
intVal int
|
||||
}
|
||||
|
||||
func (posVal *positionValidation) Error() error {
|
||||
return posVal.err
|
||||
}
|
||||
|
||||
func (posVal *positionValidation) HasError() bool {
|
||||
return posVal.err != nil
|
||||
}
|
||||
|
||||
func (posVal *positionValidation) IntValue() int {
|
||||
return posVal.intVal
|
||||
}
|
||||
|
||||
// String returns the Stringer representation of the positionValidation
|
||||
func (posVal *positionValidation) String() string {
|
||||
return fmt.Sprintf("Invalid value for %s:\t%d", aurora.Yellow(posVal.name), posVal.intVal)
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func newPositionValidation(name string, intVal int, err error) *positionValidation {
|
||||
posVal := &positionValidation{
|
||||
err: err,
|
||||
name: name,
|
||||
intVal: intVal,
|
||||
}
|
||||
|
||||
return posVal
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package cfg
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
var (
|
||||
posVal = &positionValidation{
|
||||
err: errors.New("Busted"),
|
||||
name: "top",
|
||||
intVal: -3,
|
||||
}
|
||||
)
|
||||
|
||||
func Test_Attributes(t *testing.T) {
|
||||
assert.EqualError(t, posVal.Error(), "Busted")
|
||||
assert.Equal(t, true, posVal.HasError())
|
||||
assert.Equal(t, -3, posVal.IntValue())
|
||||
|
||||
assert.Contains(t, posVal.String(), "Invalid")
|
||||
assert.Contains(t, posVal.String(), "top")
|
||||
assert.Contains(t, posVal.String(), "-3")
|
||||
}
|
224
cfg/secrets.go
224
cfg/secrets.go
@ -1,224 +0,0 @@
|
||||
package cfg
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"runtime"
|
||||
|
||||
"github.com/docker/docker-credential-helpers/client"
|
||||
"github.com/docker/docker-credential-helpers/credentials"
|
||||
"github.com/olebedev/config"
|
||||
"github.com/wtfutil/wtf/logger"
|
||||
)
|
||||
|
||||
type SecretLoadParams struct {
|
||||
name string
|
||||
globalConfig *config.Config
|
||||
service string
|
||||
|
||||
secret *string
|
||||
}
|
||||
|
||||
// Load module secrets.
|
||||
//
|
||||
// The credential helpers impose this structure:
|
||||
//
|
||||
// SERVICE is mapped to a SECRET and USERNAME
|
||||
//
|
||||
// Only SECRET is secret, SERVICE and USERNAME are not, so this
|
||||
// API doesn't expose USERNAME.
|
||||
//
|
||||
// SERVICE was intended to be the URL of an API server, but
|
||||
// for hosted services that do not have or need a configurable
|
||||
// API server, its easier to just use the module name as the
|
||||
// SERVICE:
|
||||
//
|
||||
// cfg.ModuleSecret(name, globalConfig, &settings.apiKey).Load()
|
||||
//
|
||||
// The user will use the module name as the service, and the API key as
|
||||
// the secret, for example:
|
||||
//
|
||||
// % wtfutil save-secret circleci
|
||||
// Secret: ...
|
||||
//
|
||||
// If a module (such as pihole, jenkins, or github) might have multiple
|
||||
// instantiations each using a different API service (with its own unique
|
||||
// API key), then the module should use the API URL to lookup the secret.
|
||||
// For example, for github:
|
||||
//
|
||||
// cfg.ModuleSecret(name, globalConfig, &settings.apiKey).
|
||||
// Service(settings.baseURL).
|
||||
// Load()
|
||||
//
|
||||
// The user will use the API URL as the service, and the API key as the
|
||||
// secret, for example, with github configured as:
|
||||
//
|
||||
// -- config.yml
|
||||
// mods:
|
||||
// github:
|
||||
// baseURL: "https://github.mycompany.com/api/v3"
|
||||
// ...
|
||||
//
|
||||
// the secret must be saved as:
|
||||
//
|
||||
// % wtfutil save-secret https://github.mycompany.com/api/v3
|
||||
// Secret: ...
|
||||
//
|
||||
// If baseURL is not set in the configuration it will be the modules
|
||||
// default, and the SERVICE will default to the module name, "github",
|
||||
// and the user must save the secret as:
|
||||
//
|
||||
// % wtfutil save-secret github
|
||||
// Secret: ...
|
||||
//
|
||||
// Ideally, the individual module documentation would describe the
|
||||
// SERVICE name to use to save the secret.
|
||||
func ModuleSecret(name string, globalConfig *config.Config, secret *string) *SecretLoadParams {
|
||||
return &SecretLoadParams{
|
||||
name: name,
|
||||
globalConfig: globalConfig,
|
||||
secret: secret,
|
||||
service: name, // Default the service to the module name
|
||||
}
|
||||
}
|
||||
|
||||
func (slp *SecretLoadParams) Service(service string) *SecretLoadParams {
|
||||
if service != "" {
|
||||
slp.service = service
|
||||
}
|
||||
return slp
|
||||
}
|
||||
|
||||
func (slp *SecretLoadParams) Load() {
|
||||
configureSecret(
|
||||
slp.globalConfig,
|
||||
slp.service,
|
||||
slp.secret,
|
||||
)
|
||||
}
|
||||
|
||||
type Secret struct {
|
||||
Service string
|
||||
Secret string
|
||||
Username string
|
||||
Store string
|
||||
}
|
||||
|
||||
func configureSecret(
|
||||
globalConfig *config.Config,
|
||||
service string,
|
||||
secret *string,
|
||||
) {
|
||||
if service == "" {
|
||||
return
|
||||
}
|
||||
|
||||
if secret == nil {
|
||||
return
|
||||
}
|
||||
|
||||
// Don't overwrite the secret if it was configured with yaml
|
||||
if *secret != "" {
|
||||
return
|
||||
}
|
||||
|
||||
cred, err := FetchSecret(globalConfig, service)
|
||||
|
||||
if err != nil {
|
||||
logger.Log(fmt.Sprintf("Loading secret failed: %s", err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
if cred == nil {
|
||||
// No secret store configued.
|
||||
return
|
||||
}
|
||||
|
||||
if secret != nil && *secret == "" {
|
||||
*secret = cred.Secret
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch secret for `service`. Service is customarily a URL, but can be any
|
||||
// identifier uniquely used by wtf to identify the service, such as the name
|
||||
// of the module. nil is returned if the secretStore global property is not
|
||||
// present or the secret is not found in that store.
|
||||
func FetchSecret(globalConfig *config.Config, service string) (*Secret, error) {
|
||||
prog := newProgram(globalConfig)
|
||||
|
||||
if prog == nil {
|
||||
// No secret store configured.
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
cred, err := client.Get(prog.runner, service)
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("get %v from %v: %w", service, prog.store, err)
|
||||
}
|
||||
|
||||
return &Secret{
|
||||
Service: cred.ServerURL,
|
||||
Secret: cred.Secret,
|
||||
Username: cred.Username,
|
||||
Store: prog.store,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func StoreSecret(globalConfig *config.Config, secret *Secret) error {
|
||||
prog := newProgram(globalConfig)
|
||||
|
||||
if prog == nil {
|
||||
return errors.New("cannot store secrets: wtf.secretStore is not configured")
|
||||
}
|
||||
|
||||
cred := &credentials.Credentials{
|
||||
ServerURL: secret.Service,
|
||||
Username: secret.Username,
|
||||
Secret: secret.Secret,
|
||||
}
|
||||
|
||||
// docker-credential requires a username, but it isn't necessary for
|
||||
// all services. Use a default if a username was not set.
|
||||
if cred.Username == "" {
|
||||
cred.Username = "default"
|
||||
}
|
||||
|
||||
err := client.Store(prog.runner, cred)
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("store %v: %w", prog.store, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type program struct {
|
||||
store string
|
||||
runner client.ProgramFunc
|
||||
}
|
||||
|
||||
func newProgram(globalConfig *config.Config) *program {
|
||||
secretStore := globalConfig.UString("wtf.secretStore", "(none)")
|
||||
|
||||
if secretStore == "(none)" {
|
||||
return nil
|
||||
}
|
||||
|
||||
if secretStore == "" {
|
||||
switch runtime.GOOS {
|
||||
case "windows":
|
||||
secretStore = "winrt"
|
||||
case "darwin":
|
||||
secretStore = "osxkeychain"
|
||||
default:
|
||||
secretStore = "secretservice"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return &program{
|
||||
secretStore,
|
||||
client.NewShellProgramFunc("docker-credential-" + secretStore),
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
package cfg
|
||||
|
||||
// Validatable is implemented by any value that validates a configuration setting
|
||||
type Validatable interface {
|
||||
Error() error
|
||||
HasError() bool
|
||||
String() string
|
||||
IntValue() int
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
package cfg
|
||||
|
||||
// Validations represent a collection of config setting validations
|
||||
type Validations struct {
|
||||
validations map[string]Validatable
|
||||
}
|
||||
|
||||
// NewValidations creates and returns an instance of Validations
|
||||
func NewValidations() *Validations {
|
||||
vals := &Validations{
|
||||
validations: make(map[string]Validatable),
|
||||
}
|
||||
|
||||
return vals
|
||||
}
|
||||
|
||||
func (vals *Validations) append(key string, posVal Validatable) {
|
||||
vals.validations[key] = posVal
|
||||
}
|
||||
|
||||
func (vals *Validations) intValueFor(key string) int {
|
||||
val := vals.validations[key]
|
||||
if val != nil {
|
||||
return val.IntValue()
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
package cfg
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
var (
|
||||
vals = NewValidations()
|
||||
)
|
||||
|
||||
func Test_intValueFor(t *testing.T) {
|
||||
vals.append("left", newPositionValidation("left", 3, nil))
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
key string
|
||||
expected int
|
||||
}{
|
||||
{
|
||||
name: "with valid key",
|
||||
key: "left",
|
||||
expected: 3,
|
||||
},
|
||||
{
|
||||
name: "with invalid key",
|
||||
key: "cat",
|
||||
expected: 0,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
assert.Equal(t, tt.expected, vals.intValueFor(tt.key))
|
||||
})
|
||||
}
|
||||
}
|
@ -3,18 +3,14 @@ package checklist
|
||||
// Checklist is a module for creating generic checklist implementations
|
||||
// See 'Todo' for an implementation example
|
||||
type Checklist struct {
|
||||
Items []*ChecklistItem
|
||||
Selected int
|
||||
|
||||
checkedIcon string
|
||||
selected int
|
||||
uncheckedIcon string
|
||||
Items []*ChecklistItem
|
||||
}
|
||||
|
||||
func NewChecklist(checkedIcon, uncheckedIcon string) Checklist {
|
||||
func NewChecklist() Checklist {
|
||||
list := Checklist{
|
||||
checkedIcon: checkedIcon,
|
||||
selected: -1,
|
||||
uncheckedIcon: uncheckedIcon,
|
||||
Selected: -1,
|
||||
}
|
||||
|
||||
return list
|
||||
@ -22,17 +18,14 @@ func NewChecklist(checkedIcon, uncheckedIcon string) Checklist {
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
// Add creates a new checklist item and prepends it onto the existing
|
||||
// list of items. The new one is at the start of the list
|
||||
// Add creates a new item in the checklist
|
||||
func (list *Checklist) Add(checked bool, text string) {
|
||||
item := NewChecklistItem(
|
||||
checked,
|
||||
text,
|
||||
list.checkedIcon,
|
||||
list.uncheckedIcon,
|
||||
)
|
||||
item := ChecklistItem{
|
||||
Checked: checked,
|
||||
Text: text,
|
||||
}
|
||||
|
||||
list.Items = append([]*ChecklistItem{item}, list.Items...)
|
||||
list.Items = append([]*ChecklistItem{&item}, list.Items...)
|
||||
}
|
||||
|
||||
// CheckedItems returns a slice of all the checked items
|
||||
@ -49,15 +42,29 @@ func (list *Checklist) CheckedItems() []*ChecklistItem {
|
||||
}
|
||||
|
||||
// Delete removes the selected item from the checklist
|
||||
func (list *Checklist) Delete(selectedIndex int) {
|
||||
if selectedIndex >= 0 && selectedIndex < len(list.Items) {
|
||||
list.Items = append(list.Items[:selectedIndex], list.Items[selectedIndex+1:]...)
|
||||
func (list *Checklist) Delete() {
|
||||
list.Items = append(list.Items[:list.Selected], list.Items[list.Selected+1:]...)
|
||||
list.Prev()
|
||||
}
|
||||
|
||||
// Demote moves the selected item down in the checklist
|
||||
func (list *Checklist) Demote() {
|
||||
if list.IsUnselectable() {
|
||||
return
|
||||
}
|
||||
|
||||
j := list.Selected + 1
|
||||
if j >= len(list.Items) {
|
||||
j = 0
|
||||
}
|
||||
|
||||
list.Swap(list.Selected, j)
|
||||
list.Selected = j
|
||||
}
|
||||
|
||||
// IsSelectable returns true if the checklist has selectable items, false if it does not
|
||||
func (list *Checklist) IsSelectable() bool {
|
||||
return list.selected >= 0 && list.selected < len(list.Items)
|
||||
return list.Selected >= 0 && list.Selected < len(list.Items)
|
||||
}
|
||||
|
||||
// IsUnselectable returns true if the checklist has no selectable items, false if it does
|
||||
@ -65,6 +72,14 @@ func (list *Checklist) IsUnselectable() bool {
|
||||
return !list.IsSelectable()
|
||||
}
|
||||
|
||||
// Next selects the next item in the checklist
|
||||
func (list *Checklist) Next() {
|
||||
list.Selected = list.Selected + 1
|
||||
if list.Selected >= len(list.Items) {
|
||||
list.Selected = 0
|
||||
}
|
||||
}
|
||||
|
||||
// LongestLine returns the length of the longest checklist item's text
|
||||
func (list *Checklist) LongestLine() int {
|
||||
maxLen := 0
|
||||
@ -78,14 +93,54 @@ func (list *Checklist) LongestLine() int {
|
||||
return maxLen
|
||||
}
|
||||
|
||||
// IndexByItem returns the index of a giving item if found, otherwise returns 0 with ok set to false
|
||||
func (list *Checklist) IndexByItem(selectableItem *ChecklistItem) (index int, ok bool) {
|
||||
// Prev selects the previous item in the checklist
|
||||
func (list *Checklist) Prev() {
|
||||
list.Selected = list.Selected - 1
|
||||
if list.Selected < 0 {
|
||||
list.Selected = len(list.Items) - 1
|
||||
}
|
||||
}
|
||||
|
||||
// Promote moves the selected item up in the checklist
|
||||
func (list *Checklist) Promote() {
|
||||
if list.IsUnselectable() {
|
||||
return
|
||||
}
|
||||
|
||||
j := list.Selected - 1
|
||||
if j < 0 {
|
||||
j = len(list.Items) - 1
|
||||
}
|
||||
|
||||
list.Swap(list.Selected, j)
|
||||
list.Selected = j
|
||||
}
|
||||
|
||||
// SelectedItem returns the currently-selected checklist item or nil if no item is selected
|
||||
func (list *Checklist) SelectedItem() *ChecklistItem {
|
||||
if list.IsUnselectable() {
|
||||
return nil
|
||||
}
|
||||
|
||||
return list.Items[list.Selected]
|
||||
}
|
||||
|
||||
func (list *Checklist) SetSelectedByItem(selectableItem *ChecklistItem) {
|
||||
for idx, item := range list.Items {
|
||||
if item == selectableItem {
|
||||
return idx, true
|
||||
list.Selected = idx
|
||||
break
|
||||
}
|
||||
}
|
||||
return 0, false
|
||||
}
|
||||
|
||||
// Toggle switches the checked state of the currently-selected item
|
||||
func (list *Checklist) Toggle() {
|
||||
if list.IsUnselectable() {
|
||||
return
|
||||
}
|
||||
|
||||
list.SelectedItem().Toggle()
|
||||
}
|
||||
|
||||
// UncheckedItems returns a slice of all the unchecked items
|
||||
@ -103,7 +158,18 @@ func (list *Checklist) UncheckedItems() []*ChecklistItem {
|
||||
|
||||
// Unselect removes the current select such that no item is selected
|
||||
func (list *Checklist) Unselect() {
|
||||
list.selected = -1
|
||||
list.Selected = -1
|
||||
}
|
||||
|
||||
// Update sets the text of the currently-selected item to the provided text
|
||||
func (list *Checklist) Update(text string) {
|
||||
item := list.SelectedItem()
|
||||
|
||||
if item == nil {
|
||||
return
|
||||
}
|
||||
|
||||
item.Text = text
|
||||
}
|
||||
|
||||
/* -------------------- Sort Interface -------------------- */
|
||||
|
@ -1,34 +1,23 @@
|
||||
package checklist
|
||||
|
||||
import (
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
// ChecklistItem is a module for creating generic checklist implementations
|
||||
// See 'Todo' for an implementation example
|
||||
type ChecklistItem struct {
|
||||
Checked bool
|
||||
CheckedIcon string
|
||||
Text string
|
||||
UncheckedIcon string
|
||||
}
|
||||
|
||||
func NewChecklistItem(checked bool, text string, checkedIcon, uncheckedIcon string) *ChecklistItem {
|
||||
item := &ChecklistItem{
|
||||
Checked: checked,
|
||||
CheckedIcon: checkedIcon,
|
||||
Text: text,
|
||||
UncheckedIcon: uncheckedIcon,
|
||||
}
|
||||
|
||||
return item
|
||||
Checked bool
|
||||
Text string
|
||||
}
|
||||
|
||||
// CheckMark returns the string used to indicate a ChecklistItem is checked or unchecked
|
||||
func (item *ChecklistItem) CheckMark() string {
|
||||
item.ensureItemIcons()
|
||||
|
||||
if item.Checked {
|
||||
return item.CheckedIcon
|
||||
return wtf.Config.UString("wtf.mods.todo.checkedIcon", "x")
|
||||
}
|
||||
|
||||
return item.UncheckedIcon
|
||||
return " "
|
||||
}
|
||||
|
||||
// Toggle changes the checked state of the ChecklistItem
|
||||
@ -36,15 +25,3 @@ func (item *ChecklistItem) CheckMark() string {
|
||||
func (item *ChecklistItem) Toggle() {
|
||||
item.Checked = !item.Checked
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func (item *ChecklistItem) ensureItemIcons() {
|
||||
if item.CheckedIcon == "" {
|
||||
item.CheckedIcon = "x"
|
||||
}
|
||||
|
||||
if item.UncheckedIcon == "" {
|
||||
item.UncheckedIcon = " "
|
||||
}
|
||||
}
|
||||
|
@ -1,36 +0,0 @@
|
||||
package checklist
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func testChecklistItem() *ChecklistItem {
|
||||
item := NewChecklistItem(
|
||||
false,
|
||||
"test",
|
||||
"",
|
||||
"",
|
||||
)
|
||||
return item
|
||||
}
|
||||
|
||||
func Test_CheckMark(t *testing.T) {
|
||||
item := testChecklistItem()
|
||||
Equal(t, " ", item.CheckMark())
|
||||
|
||||
item.Toggle()
|
||||
Equal(t, "x", item.CheckMark())
|
||||
}
|
||||
|
||||
func Test_Toggle(t *testing.T) {
|
||||
item := testChecklistItem()
|
||||
Equal(t, false, item.Checked)
|
||||
|
||||
item.Toggle()
|
||||
Equal(t, true, item.Checked)
|
||||
|
||||
item.Toggle()
|
||||
Equal(t, false, item.Checked)
|
||||
}
|
@ -1,436 +0,0 @@
|
||||
package checklist
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_NewCheckist(t *testing.T) {
|
||||
cl := NewChecklist("o", "-")
|
||||
|
||||
assert.IsType(t, Checklist{}, cl)
|
||||
assert.Equal(t, "o", cl.checkedIcon)
|
||||
assert.Equal(t, -1, cl.selected)
|
||||
assert.Equal(t, "-", cl.uncheckedIcon)
|
||||
assert.Equal(t, 0, len(cl.Items))
|
||||
}
|
||||
|
||||
func Test_Add(t *testing.T) {
|
||||
cl := NewChecklist("o", "-")
|
||||
cl.Add(true, "test item")
|
||||
|
||||
assert.Equal(t, 1, len(cl.Items))
|
||||
}
|
||||
|
||||
func Test_CheckedItems(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
expectedLen int
|
||||
checkedLen int
|
||||
before func(cl *Checklist)
|
||||
}{
|
||||
{
|
||||
name: "with no items",
|
||||
expectedLen: 0,
|
||||
checkedLen: 0,
|
||||
before: func(cl *Checklist) {},
|
||||
},
|
||||
{
|
||||
name: "with no checked items",
|
||||
expectedLen: 1,
|
||||
checkedLen: 0,
|
||||
before: func(cl *Checklist) {
|
||||
cl.Add(false, "unchecked item")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "with one checked item",
|
||||
expectedLen: 2,
|
||||
checkedLen: 1,
|
||||
before: func(cl *Checklist) {
|
||||
cl.Add(false, "unchecked item")
|
||||
cl.Add(true, "checked item")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "with multiple checked items",
|
||||
expectedLen: 3,
|
||||
checkedLen: 2,
|
||||
before: func(cl *Checklist) {
|
||||
cl.Add(false, "unchecked item")
|
||||
cl.Add(true, "checked item 11")
|
||||
cl.Add(true, "checked item 2")
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
cl := NewChecklist("o", "-")
|
||||
tt.before(&cl)
|
||||
|
||||
assert.Equal(t, tt.expectedLen, len(cl.Items))
|
||||
assert.Equal(t, tt.checkedLen, len(cl.CheckedItems()))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_Delete(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
idx int
|
||||
expectedLen int
|
||||
}{
|
||||
{
|
||||
name: "with valid index",
|
||||
idx: 0,
|
||||
expectedLen: 0,
|
||||
},
|
||||
{
|
||||
name: "with invalid index",
|
||||
idx: 2,
|
||||
expectedLen: 1,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
cl := NewChecklist("o", "-")
|
||||
|
||||
cl.Add(true, "test item")
|
||||
cl.Delete(tt.idx)
|
||||
|
||||
assert.Equal(t, tt.expectedLen, len(cl.Items))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_IsSelectable(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
selected int
|
||||
expected bool
|
||||
}{
|
||||
{
|
||||
name: "nothing selected",
|
||||
selected: -1,
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "valid selection",
|
||||
selected: 1,
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
name: "invalid selection",
|
||||
selected: 3,
|
||||
expected: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
cl := NewChecklist("o", "-")
|
||||
cl.Add(true, "test item 1")
|
||||
cl.Add(false, "test item 2")
|
||||
|
||||
cl.selected = tt.selected
|
||||
|
||||
assert.Equal(t, tt.expected, cl.IsSelectable())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_IsUnselectable(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
selected int
|
||||
expected bool
|
||||
}{
|
||||
{
|
||||
name: "nothing selected",
|
||||
selected: -1,
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
name: "valid selection",
|
||||
selected: 1,
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "invalid selection",
|
||||
selected: 3,
|
||||
expected: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
cl := NewChecklist("o", "-")
|
||||
cl.Add(true, "test item 1")
|
||||
cl.Add(false, "test item 2")
|
||||
|
||||
cl.selected = tt.selected
|
||||
|
||||
assert.Equal(t, tt.expected, cl.IsUnselectable())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_LongestLine(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
expectedLen int
|
||||
before func(cl *Checklist)
|
||||
}{
|
||||
{
|
||||
name: "with no items",
|
||||
expectedLen: 0,
|
||||
before: func(cl *Checklist) {},
|
||||
},
|
||||
{
|
||||
name: "with different-length items",
|
||||
expectedLen: 12,
|
||||
before: func(cl *Checklist) {
|
||||
cl.Add(true, "test item 1")
|
||||
cl.Add(false, "test item 22")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "with same-length items",
|
||||
expectedLen: 11,
|
||||
before: func(cl *Checklist) {
|
||||
cl.Add(true, "test item 1")
|
||||
cl.Add(false, "test item 2")
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
cl := NewChecklist("o", "-")
|
||||
tt.before(&cl)
|
||||
|
||||
assert.Equal(t, tt.expectedLen, cl.LongestLine())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_IndexByItem(t *testing.T) {
|
||||
cl := NewChecklist("o", "-")
|
||||
cl.Add(false, "unchecked item")
|
||||
cl.Add(true, "checked item")
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
item *ChecklistItem
|
||||
expectedIdx int
|
||||
expectedOk bool
|
||||
}{
|
||||
{
|
||||
name: "with nil",
|
||||
item: nil,
|
||||
expectedIdx: 0,
|
||||
expectedOk: false,
|
||||
},
|
||||
{
|
||||
name: "with valid item",
|
||||
item: cl.Items[1],
|
||||
expectedIdx: 1,
|
||||
expectedOk: true,
|
||||
},
|
||||
{
|
||||
name: "with valid item",
|
||||
item: NewChecklistItem(false, "invalid", "x", " "),
|
||||
expectedIdx: 0,
|
||||
expectedOk: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
||||
idx, ok := cl.IndexByItem(tt.item)
|
||||
|
||||
assert.Equal(t, tt.expectedIdx, idx)
|
||||
assert.Equal(t, tt.expectedOk, ok)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_UncheckedItems(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
expectedLen int
|
||||
checkedLen int
|
||||
before func(cl *Checklist)
|
||||
}{
|
||||
{
|
||||
name: "with no items",
|
||||
expectedLen: 0,
|
||||
checkedLen: 0,
|
||||
before: func(cl *Checklist) {},
|
||||
},
|
||||
{
|
||||
name: "with no unchecked items",
|
||||
expectedLen: 1,
|
||||
checkedLen: 0,
|
||||
before: func(cl *Checklist) {
|
||||
cl.Add(true, "unchecked item")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "with one unchecked item",
|
||||
expectedLen: 2,
|
||||
checkedLen: 1,
|
||||
before: func(cl *Checklist) {
|
||||
cl.Add(false, "unchecked item")
|
||||
cl.Add(true, "checked item")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "with multiple unchecked items",
|
||||
expectedLen: 3,
|
||||
checkedLen: 2,
|
||||
before: func(cl *Checklist) {
|
||||
cl.Add(false, "unchecked item")
|
||||
cl.Add(true, "checked item 11")
|
||||
cl.Add(false, "checked item 2")
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
cl := NewChecklist("o", "-")
|
||||
tt.before(&cl)
|
||||
|
||||
assert.Equal(t, tt.expectedLen, len(cl.Items))
|
||||
assert.Equal(t, tt.checkedLen, len(cl.UncheckedItems()))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_Unselect(t *testing.T) {
|
||||
cl := NewChecklist("o", "-")
|
||||
cl.Add(false, "unchecked item")
|
||||
|
||||
cl.selected = 0
|
||||
assert.Equal(t, 0, cl.selected)
|
||||
|
||||
cl.Unselect()
|
||||
assert.Equal(t, -1, cl.selected)
|
||||
}
|
||||
|
||||
/* -------------------- Sort Interface -------------------- */
|
||||
|
||||
func Test_Len(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
expectedLen int
|
||||
before func(cl *Checklist)
|
||||
}{
|
||||
{
|
||||
name: "with no items",
|
||||
expectedLen: 0,
|
||||
before: func(cl *Checklist) {},
|
||||
},
|
||||
{
|
||||
name: "with one item",
|
||||
expectedLen: 1,
|
||||
before: func(cl *Checklist) {
|
||||
cl.Add(false, "unchecked item")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "with multiple items",
|
||||
expectedLen: 3,
|
||||
before: func(cl *Checklist) {
|
||||
cl.Add(false, "unchecked item")
|
||||
cl.Add(true, "checked item 1")
|
||||
cl.Add(false, "checked item 2")
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
cl := NewChecklist("o", "-")
|
||||
tt.before(&cl)
|
||||
|
||||
assert.Equal(t, tt.expectedLen, cl.Len())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_Less(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
first string
|
||||
second string
|
||||
expected bool
|
||||
}{
|
||||
{
|
||||
name: "same",
|
||||
first: "",
|
||||
second: "",
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "last less",
|
||||
first: "beta",
|
||||
second: "alpha",
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
name: "first less",
|
||||
first: "alpha",
|
||||
second: "beta",
|
||||
expected: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
cl := NewChecklist("o", "-")
|
||||
cl.Add(false, tt.first)
|
||||
cl.Add(false, tt.second)
|
||||
|
||||
assert.Equal(t, tt.expected, cl.Less(0, 1))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_Swap(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
first string
|
||||
second string
|
||||
expected bool
|
||||
}{
|
||||
{
|
||||
name: "same",
|
||||
first: "",
|
||||
second: "",
|
||||
},
|
||||
{
|
||||
name: "last less",
|
||||
first: "alpha",
|
||||
second: "beta",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
cl := NewChecklist("o", "-")
|
||||
cl.Add(false, tt.first)
|
||||
cl.Add(false, tt.second)
|
||||
|
||||
cl.Swap(0, 1)
|
||||
|
||||
assert.Equal(t, tt.expected, cl.Items[0].Text == "beta")
|
||||
assert.Equal(t, tt.expected, cl.Items[1].Text == "alpha")
|
||||
})
|
||||
}
|
||||
}
|
43
checklist_tests/checklist_item_test.go
Normal file
43
checklist_tests/checklist_item_test.go
Normal file
@ -0,0 +1,43 @@
|
||||
package wtftests
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/olebedev/config"
|
||||
. "github.com/stretchr/testify/assert"
|
||||
. "github.com/wtfutil/wtf/checklist"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
/* -------------------- CheckMark -------------------- */
|
||||
|
||||
func TestCheckMark(t *testing.T) {
|
||||
loadConfig()
|
||||
|
||||
item := ChecklistItem{}
|
||||
Equal(t, " ", item.CheckMark())
|
||||
|
||||
item = ChecklistItem{Checked: true}
|
||||
Equal(t, "x", item.CheckMark())
|
||||
}
|
||||
|
||||
/* -------------------- Toggle -------------------- */
|
||||
|
||||
func TestToggle(t *testing.T) {
|
||||
loadConfig()
|
||||
|
||||
item := ChecklistItem{}
|
||||
Equal(t, false, item.Checked)
|
||||
|
||||
item.Toggle()
|
||||
Equal(t, true, item.Checked)
|
||||
|
||||
item.Toggle()
|
||||
Equal(t, false, item.Checked)
|
||||
}
|
||||
|
||||
/* -------------------- helpers -------------------- */
|
||||
|
||||
func loadConfig() {
|
||||
wtf.Config, _ = config.ParseYamlFile("../_sample_configs/simple_config.yml")
|
||||
}
|
@ -2,38 +2,28 @@ package circleci
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
|
||||
"github.com/wtfutil/wtf/utils"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
apiKey string
|
||||
}
|
||||
const APIEnvKey = "WTF_CIRCLE_API_KEY"
|
||||
|
||||
func NewClient(apiKey string) *Client {
|
||||
client := Client{
|
||||
apiKey: apiKey,
|
||||
}
|
||||
|
||||
return &client
|
||||
}
|
||||
|
||||
func (client *Client) BuildsFor() ([]*Build, error) {
|
||||
func BuildsFor() ([]*Build, error) {
|
||||
builds := []*Build{}
|
||||
|
||||
resp, err := client.circleRequest("recent-builds")
|
||||
resp, err := circleRequest("recent-builds")
|
||||
if err != nil {
|
||||
return builds, err
|
||||
}
|
||||
|
||||
err = utils.ParseJSON(&builds, bytes.NewReader(resp))
|
||||
if err != nil {
|
||||
return builds, err
|
||||
}
|
||||
parseJson(&builds, resp.Body)
|
||||
|
||||
return builds, nil
|
||||
}
|
||||
@ -44,9 +34,9 @@ var (
|
||||
circleAPIURL = &url.URL{Scheme: "https", Host: "circleci.com", Path: "/api/v1/"}
|
||||
)
|
||||
|
||||
func (client *Client) circleRequest(path string) ([]byte, error) {
|
||||
func circleRequest(path string) (*http.Response, error) {
|
||||
params := url.Values{}
|
||||
params.Add("circle-token", client.apiKey)
|
||||
params.Add("circle-token", apiKey())
|
||||
|
||||
url := circleAPIURL.ResolveReference(&url.URL{Path: path, RawQuery: params.Encode()})
|
||||
|
||||
@ -63,15 +53,33 @@ func (client *Client) circleRequest(path string) ([]byte, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
|
||||
if resp.StatusCode < 200 || resp.StatusCode > 299 {
|
||||
return nil, fmt.Errorf(resp.Status)
|
||||
}
|
||||
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return body, nil
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func apiKey() string {
|
||||
return wtf.Config.UString(
|
||||
"wtf.mods.circleci.apiKey",
|
||||
os.Getenv(APIEnvKey),
|
||||
)
|
||||
}
|
||||
|
||||
func parseJson(obj interface{}, text io.Reader) {
|
||||
jsonStream, err := ioutil.ReadAll(text)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(jsonStream))
|
||||
|
||||
for {
|
||||
if err := decoder.Decode(obj); err == io.EOF {
|
||||
break
|
||||
} else if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
80
circleci/widget.go
Normal file
80
circleci/widget.go
Normal file
@ -0,0 +1,80 @@
|
||||
package circleci
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/rivo/tview"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
type Widget struct {
|
||||
wtf.TextWidget
|
||||
}
|
||||
|
||||
func NewWidget(app *tview.Application) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(app, "CircleCI", "circleci", false),
|
||||
}
|
||||
|
||||
return &widget
|
||||
}
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
if widget.Disabled() {
|
||||
return
|
||||
}
|
||||
|
||||
builds, err := BuildsFor()
|
||||
|
||||
widget.View.SetTitle(fmt.Sprintf("%s - Builds", widget.Name))
|
||||
|
||||
var content string
|
||||
if err != nil {
|
||||
widget.View.SetWrap(true)
|
||||
content = err.Error()
|
||||
} else {
|
||||
widget.View.SetWrap(false)
|
||||
content = widget.contentFrom(builds)
|
||||
}
|
||||
|
||||
widget.View.SetText(content)
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) contentFrom(builds []*Build) string {
|
||||
var str string
|
||||
for idx, build := range builds {
|
||||
if idx > 10 {
|
||||
return str
|
||||
}
|
||||
|
||||
str = str + fmt.Sprintf(
|
||||
"[%s] %s-%d (%s) [white]%s\n",
|
||||
buildColor(build),
|
||||
build.Reponame,
|
||||
build.BuildNum,
|
||||
build.Branch,
|
||||
build.AuthorName,
|
||||
)
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
func buildColor(build *Build) string {
|
||||
switch build.Status {
|
||||
case "failed":
|
||||
return "red"
|
||||
case "running":
|
||||
return "yellow"
|
||||
case "success":
|
||||
return "green"
|
||||
case "fixed":
|
||||
return "green"
|
||||
default:
|
||||
return "white"
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
package clocks
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -19,14 +18,6 @@ func NewClock(label string, timeLoc *time.Location) Clock {
|
||||
return clock
|
||||
}
|
||||
|
||||
func BuildClock(label string, location string) (clock Clock, err error) {
|
||||
timeLoc, err := time.LoadLocation(sanitizeLocation(location))
|
||||
if err != nil {
|
||||
return Clock{}, err
|
||||
}
|
||||
return NewClock(label, timeLoc), nil
|
||||
}
|
||||
|
||||
func (clock *Clock) Date(dateFormat string) string {
|
||||
return clock.LocalTime().Format(dateFormat)
|
||||
}
|
||||
@ -42,7 +33,3 @@ func (clock *Clock) ToLocal(t time.Time) time.Time {
|
||||
func (clock *Clock) Time(timeFormat string) string {
|
||||
return clock.LocalTime().Format(timeFormat)
|
||||
}
|
||||
|
||||
func sanitizeLocation(locStr string) string {
|
||||
return strings.Replace(locStr, " ", "_", -1)
|
||||
}
|
@ -3,16 +3,16 @@ package clocks
|
||||
import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
type ClockCollection struct {
|
||||
Clocks []Clock
|
||||
}
|
||||
|
||||
func (clocks *ClockCollection) Sorted(sortOrder string) []Clock {
|
||||
if sortOrder == "natural" {
|
||||
//no-op
|
||||
} else if sortOrder == "chronological" {
|
||||
func (clocks *ClockCollection) Sorted() []Clock {
|
||||
if "chronological" == wtf.Config.UString("wtf.mods.clocks.sort", "alphabetical") {
|
||||
clocks.SortedChronologically()
|
||||
} else {
|
||||
clocks.SortedAlphabetically()
|
27
clocks/display.go
Normal file
27
clocks/display.go
Normal file
@ -0,0 +1,27 @@
|
||||
package clocks
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
func (widget *Widget) display(clocks []Clock, dateFormat string, timeFormat string) {
|
||||
if len(clocks) == 0 {
|
||||
widget.View.SetText(fmt.Sprintf("\n%s", " no timezone data available"))
|
||||
return
|
||||
}
|
||||
|
||||
str := ""
|
||||
for idx, clock := range clocks {
|
||||
str = str + fmt.Sprintf(
|
||||
" [%s]%-12s %-10s %7s[white]\n",
|
||||
wtf.RowColor("clocks", idx),
|
||||
clock.Label,
|
||||
clock.Time(timeFormat),
|
||||
clock.Date(dateFormat),
|
||||
)
|
||||
}
|
||||
|
||||
widget.View.SetText(str)
|
||||
}
|
57
clocks/widget.go
Normal file
57
clocks/widget.go
Normal file
@ -0,0 +1,57 @@
|
||||
package clocks
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/rivo/tview"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
type Widget struct {
|
||||
wtf.TextWidget
|
||||
|
||||
clockColl ClockCollection
|
||||
dateFormat string
|
||||
timeFormat string
|
||||
}
|
||||
|
||||
func NewWidget(app *tview.Application) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(app, "World Clocks", "clocks", false),
|
||||
}
|
||||
|
||||
widget.clockColl = widget.buildClockCollection(wtf.Config.UMap("wtf.mods.clocks.locations"))
|
||||
|
||||
widget.dateFormat = wtf.Config.UString("wtf.mods.clocks.dateFormat", wtf.SimpleDateFormat)
|
||||
widget.timeFormat = wtf.Config.UString("wtf.mods.clocks.timeFormat", wtf.SimpleTimeFormat)
|
||||
|
||||
return &widget
|
||||
}
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.display(widget.clockColl.Sorted(), widget.dateFormat, widget.timeFormat)
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) buildClockCollection(locData map[string]interface{}) ClockCollection {
|
||||
clockColl := ClockCollection{}
|
||||
|
||||
for label, locStr := range locData {
|
||||
timeLoc, err := time.LoadLocation(widget.sanitizeLocation(locStr.(string)))
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
clockColl.Clocks = append(clockColl.Clocks, NewClock(label, timeLoc))
|
||||
}
|
||||
|
||||
return clockColl
|
||||
}
|
||||
|
||||
func (widget *Widget) sanitizeLocation(locStr string) string {
|
||||
return strings.Replace(locStr, " ", "_", -1)
|
||||
}
|
55
cmdrunner/widget.go
Normal file
55
cmdrunner/widget.go
Normal file
@ -0,0 +1,55 @@
|
||||
package cmdrunner
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"github.com/rivo/tview"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
type Widget struct {
|
||||
wtf.TextWidget
|
||||
|
||||
args []string
|
||||
cmd string
|
||||
result string
|
||||
}
|
||||
|
||||
func NewWidget(app *tview.Application) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(app, "CmdRunner", "cmdrunner", false),
|
||||
|
||||
args: wtf.ToStrs(wtf.Config.UList("wtf.mods.cmdrunner.args")),
|
||||
cmd: wtf.Config.UString("wtf.mods.cmdrunner.cmd"),
|
||||
}
|
||||
|
||||
widget.View.SetWrap(true)
|
||||
|
||||
return &widget
|
||||
}
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.execute()
|
||||
|
||||
title := tview.TranslateANSI(wtf.Config.UString("wtf.mods.cmdrunner.title", widget.String()))
|
||||
widget.View.SetTitle(title)
|
||||
|
||||
widget.View.SetText(widget.result)
|
||||
}
|
||||
|
||||
func (widget *Widget) String() string {
|
||||
args := strings.Join(widget.args, " ")
|
||||
|
||||
if args != "" {
|
||||
return fmt.Sprintf(" %s %s ", widget.cmd, args)
|
||||
}
|
||||
|
||||
return fmt.Sprintf(" %s ", widget.cmd)
|
||||
}
|
||||
|
||||
func (widget *Widget) execute() {
|
||||
cmd := exec.Command(widget.cmd, widget.args...)
|
||||
widget.result = tview.TranslateANSI(wtf.ExecuteCommand(cmd))
|
||||
}
|
@ -7,26 +7,19 @@ import (
|
||||
)
|
||||
|
||||
func (widget *Widget) display() {
|
||||
|
||||
widget.Redraw(widget.content)
|
||||
}
|
||||
|
||||
func (widget *Widget) content() (string, string, bool) {
|
||||
if !ok {
|
||||
return widget.CommonSettings().Title, errorText, true
|
||||
if ok == false {
|
||||
widget.View.SetText(errorText)
|
||||
return
|
||||
}
|
||||
|
||||
list := &widget.summaryList
|
||||
widget.View.SetText(summaryText(&widget.summaryList, &widget.TextColors))
|
||||
}
|
||||
|
||||
func summaryText(list *summaryList, colors *TextColors) string {
|
||||
str := ""
|
||||
|
||||
for _, baseCurrency := range list.items {
|
||||
str += fmt.Sprintf(
|
||||
" [%s]%s[%s] (%s)\n\n",
|
||||
widget.settings.colors.base.displayName,
|
||||
baseCurrency.displayName,
|
||||
widget.settings.colors.base.name,
|
||||
baseCurrency.name,
|
||||
)
|
||||
str += fmt.Sprintf(" [%s]%s[%s] (%s)\n\n", colors.base.displayName, baseCurrency.displayName, colors.base.name, baseCurrency.name)
|
||||
|
||||
resultTemplate := template.New("bittrex")
|
||||
|
||||
@ -44,10 +37,10 @@ func (widget *Widget) content() (string, string, bool) {
|
||||
formatableText("Open Sell", "OpenSellOrders"),
|
||||
)
|
||||
|
||||
err := strTemplate.Execute(writer, map[string]string{
|
||||
"nameColor": widget.settings.colors.market.name,
|
||||
"fieldColor": widget.settings.colors.market.field,
|
||||
"valueColor": widget.settings.colors.market.value,
|
||||
strTemplate.Execute(writer, map[string]string{
|
||||
"nameColor": colors.market.name,
|
||||
"fieldColor": colors.market.field,
|
||||
"valueColor": colors.market.value,
|
||||
"mName": marketCurrency.name,
|
||||
"High": marketCurrency.High,
|
||||
"Low": marketCurrency.Low,
|
||||
@ -57,16 +50,12 @@ func (widget *Widget) content() (string, string, bool) {
|
||||
"OpenSellOrders": marketCurrency.OpenSellOrders,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
str = err.Error()
|
||||
} else {
|
||||
str += writer.String() + "\n"
|
||||
}
|
||||
str += writer.String() + "\n"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return widget.CommonSettings().Title, str, true
|
||||
return str
|
||||
|
||||
}
|
||||
|
@ -8,55 +8,72 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/rivo/tview"
|
||||
"github.com/wtfutil/wtf/view"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
const (
|
||||
baseURL = "https://bittrex.com/api/v1.1/public/getmarketsummary"
|
||||
)
|
||||
type TextColors struct {
|
||||
base struct {
|
||||
name string
|
||||
displayName string
|
||||
}
|
||||
market struct {
|
||||
name string
|
||||
field string
|
||||
value string
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
errorText = ""
|
||||
ok = true
|
||||
)
|
||||
var ok = true
|
||||
var errorText = ""
|
||||
|
||||
var baseURL = "https://bittrex.com/api/v1.1/public/getmarketsummary"
|
||||
|
||||
// Widget define wtf widget to register widget later
|
||||
type Widget struct {
|
||||
view.TextWidget
|
||||
|
||||
settings *Settings
|
||||
wtf.TextWidget
|
||||
summaryList
|
||||
TextColors
|
||||
}
|
||||
|
||||
// NewWidget Make new instance of widget
|
||||
func NewWidget(tviewApp *tview.Application, settings *Settings) *Widget {
|
||||
func NewWidget(app *tview.Application) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: view.NewTextWidget(tviewApp, nil, settings.Common),
|
||||
|
||||
settings: settings,
|
||||
TextWidget: wtf.NewTextWidget(app, "Bittrex", "bittrex", false),
|
||||
summaryList: summaryList{},
|
||||
}
|
||||
|
||||
ok = true
|
||||
errorText = ""
|
||||
|
||||
widget.config()
|
||||
widget.setSummaryList()
|
||||
|
||||
return &widget
|
||||
}
|
||||
|
||||
func (widget *Widget) config() {
|
||||
widget.TextColors.base.name = wtf.Config.UString("wtf.mods.bittrex.colors.base.name", "red")
|
||||
widget.TextColors.base.displayName = wtf.Config.UString("wtf.mods.bittrex.colors.base.displayName", "grey")
|
||||
widget.TextColors.market.name = wtf.Config.UString("wtf.mods.bittrex.colors.market.name", "red")
|
||||
widget.TextColors.market.field = wtf.Config.UString("wtf.mods.bittrex.colors.market.field", "coral")
|
||||
widget.TextColors.market.value = wtf.Config.UString("wtf.mods.bittrex.colors.market.value", "white")
|
||||
}
|
||||
|
||||
func (widget *Widget) setSummaryList() {
|
||||
for symbol, currency := range widget.settings.summary.currencies {
|
||||
mCurrencyList := widget.makeSummaryMarketList(symbol, currency.market)
|
||||
widget.summaryList.addSummaryItem(symbol, currency.displayName, mCurrencyList)
|
||||
sCurrencies, _ := wtf.Config.Map("wtf.mods.bittrex.summary")
|
||||
for baseCurrencyName := range sCurrencies {
|
||||
displayName, _ := wtf.Config.String("wtf.mods.bittrex.summary." + baseCurrencyName + ".displayName")
|
||||
mCurrencyList := makeSummaryMarketList(baseCurrencyName)
|
||||
widget.summaryList.addSummaryItem(baseCurrencyName, displayName, mCurrencyList)
|
||||
}
|
||||
}
|
||||
|
||||
func (widget *Widget) makeSummaryMarketList(currencySymbol string, market []interface{}) []*mCurrency {
|
||||
func makeSummaryMarketList(currencyName string) []*mCurrency {
|
||||
mCurrencyList := []*mCurrency{}
|
||||
|
||||
for _, marketSymbol := range market {
|
||||
mCurrencyList = append(mCurrencyList, makeMarketCurrency(marketSymbol.(string)))
|
||||
configMarketList, _ := wtf.Config.List("wtf.mods.bittrex.summary." + currencyName + ".market")
|
||||
for _, mCurrencyName := range configMarketList {
|
||||
mCurrencyList = append(mCurrencyList, makeMarketCurrency(mCurrencyName.(string)))
|
||||
}
|
||||
|
||||
return mCurrencyList
|
||||
@ -81,7 +98,6 @@ func makeMarketCurrency(name string) *mCurrency {
|
||||
// Refresh & update after interval time
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.updateSummary()
|
||||
|
||||
widget.display()
|
||||
}
|
||||
|
||||
@ -90,13 +106,11 @@ func (widget *Widget) Refresh() {
|
||||
func (widget *Widget) updateSummary() {
|
||||
// In case if anything bad happened!
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
fmt.Println("recovered in updateSummary()", r)
|
||||
}
|
||||
recover()
|
||||
}()
|
||||
|
||||
client := &http.Client{
|
||||
Timeout: 5 * time.Second,
|
||||
Timeout: time.Duration(5 * time.Second),
|
||||
}
|
||||
|
||||
for _, baseCurrency := range widget.summaryList.items {
|
||||
@ -122,14 +136,10 @@ func (widget *Widget) updateSummary() {
|
||||
errorText = ""
|
||||
}
|
||||
|
||||
defer func() { _ = response.Body.Close() }()
|
||||
defer response.Body.Close()
|
||||
jsonResponse := summaryResponse{}
|
||||
decoder := json.NewDecoder(response.Body)
|
||||
err = decoder.Decode(&jsonResponse)
|
||||
if err != nil {
|
||||
errorText = "Could not parse JSON!"
|
||||
break
|
||||
}
|
||||
decoder.Decode(&jsonResponse)
|
||||
|
||||
if !jsonResponse.Success {
|
||||
ok = false
|
@ -8,22 +8,19 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/rivo/tview"
|
||||
"github.com/wtfutil/wtf/view"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
type Widget struct {
|
||||
view.TextWidget
|
||||
wtf.TextWidget
|
||||
|
||||
device_token string
|
||||
settings *Settings
|
||||
}
|
||||
|
||||
func NewWidget(tviewApp *tview.Application, settings *Settings) *Widget {
|
||||
func NewWidget(app *tview.Application) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: view.NewTextWidget(tviewApp, nil, settings.Common),
|
||||
|
||||
device_token: settings.deviceToken,
|
||||
settings: settings,
|
||||
TextWidget: wtf.NewTextWidget(app, "Blockfolio", "blockfolio", false),
|
||||
device_token: wtf.Config.UString("wtf.mods.blockfolio.device_token"),
|
||||
}
|
||||
|
||||
return &widget
|
||||
@ -32,60 +29,42 @@ func NewWidget(tviewApp *tview.Application, settings *Settings) *Widget {
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.View.SetTitle(" Blockfolio ")
|
||||
|
||||
widget.Redraw(widget.content)
|
||||
positions, err := Fetch(widget.device_token)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
widget.View.SetText(contentFrom(positions))
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
func (widget *Widget) content() (string, string, bool) {
|
||||
positions, err := Fetch(widget.device_token)
|
||||
title := widget.CommonSettings().Title
|
||||
if err != nil {
|
||||
return title, err.Error(), true
|
||||
}
|
||||
|
||||
func contentFrom(positions *AllPositionsResponse) string {
|
||||
res := ""
|
||||
totalFiat := float32(0.0)
|
||||
|
||||
colorName := wtf.Config.UString("wtf.mods.blockfolio.colors.name")
|
||||
colorGrows := wtf.Config.UString("wtf.mods.blockfolio.colors.grows")
|
||||
colorDrop := wtf.Config.UString("wtf.mods.blockfolio.colors.drop")
|
||||
displayHoldings := wtf.Config.UBool("wtf.mods.blockfolio.displayHoldings")
|
||||
var totalFiat float32
|
||||
totalFiat = 0.0
|
||||
for i := 0; i < len(positions.PositionList); i++ {
|
||||
colorForChange := widget.settings.colors.grows
|
||||
|
||||
colorForChange := colorGrows
|
||||
if positions.PositionList[i].TwentyFourHourPercentChangeFiat <= 0 {
|
||||
colorForChange = widget.settings.colors.drop
|
||||
colorForChange = colorDrop
|
||||
}
|
||||
|
||||
totalFiat += positions.PositionList[i].HoldingValueFiat
|
||||
|
||||
if widget.settings.displayHoldings {
|
||||
res += fmt.Sprintf(
|
||||
"[%s]%-6s - %5.2f ([%s]%.3fk [%s]%.2f%s)\n",
|
||||
widget.settings.colors.name,
|
||||
positions.PositionList[i].Coin,
|
||||
positions.PositionList[i].Quantity,
|
||||
colorForChange,
|
||||
positions.PositionList[i].HoldingValueFiat/1000,
|
||||
colorForChange,
|
||||
positions.PositionList[i].TwentyFourHourPercentChangeFiat,
|
||||
"%",
|
||||
)
|
||||
if displayHoldings {
|
||||
res = res + fmt.Sprintf("[%s]%-6s - %5.2f ([%s]%.3fk [%s]%.2f%s)\n", colorName, positions.PositionList[i].Coin, positions.PositionList[i].Quantity, colorForChange, positions.PositionList[i].HoldingValueFiat/1000, colorForChange, positions.PositionList[i].TwentyFourHourPercentChangeFiat, "%")
|
||||
} else {
|
||||
res += fmt.Sprintf(
|
||||
"[%s]%-6s - %5.2f ([%s]%.2f%s)\n",
|
||||
widget.settings.colors.name,
|
||||
positions.PositionList[i].Coin,
|
||||
positions.PositionList[i].Quantity,
|
||||
colorForChange,
|
||||
positions.PositionList[i].TwentyFourHourPercentChangeFiat,
|
||||
"%",
|
||||
)
|
||||
res = res + fmt.Sprintf("[%s]%-6s - %5.2f ([%s]%.2f%s)\n", colorName, positions.PositionList[i].Coin, positions.PositionList[i].Quantity, colorForChange, positions.PositionList[i].TwentyFourHourPercentChangeFiat, "%")
|
||||
}
|
||||
}
|
||||
|
||||
if widget.settings.displayHoldings {
|
||||
res += fmt.Sprintf("\n[%s]Total value: $%.3fk", "green", totalFiat/1000)
|
||||
if displayHoldings {
|
||||
res = res + fmt.Sprintf("\n[%s]Total value: $%.3fk", "green", totalFiat/1000)
|
||||
}
|
||||
|
||||
return title, res, true
|
||||
return res
|
||||
}
|
||||
|
||||
//always the same
|
||||
@ -115,7 +94,7 @@ func MakeApiRequest(token string, method string) ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
defer resp.Body.Close()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
@ -6,6 +6,8 @@ import (
|
||||
"net/http"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
var baseURL = "https://min-api.cryptocompare.com/data/price"
|
||||
@ -14,7 +16,6 @@ var ok = true
|
||||
// Widget define wtf widget to register widget later
|
||||
type Widget struct {
|
||||
*list
|
||||
settings *Settings
|
||||
|
||||
Result string
|
||||
|
||||
@ -22,10 +23,8 @@ type Widget struct {
|
||||
}
|
||||
|
||||
// NewWidget Make new instance of widget
|
||||
func NewWidget(settings *Settings) *Widget {
|
||||
widget := Widget{
|
||||
settings: settings,
|
||||
}
|
||||
func NewWidget() *Widget {
|
||||
widget := Widget{}
|
||||
|
||||
widget.setList()
|
||||
|
||||
@ -33,26 +32,33 @@ func NewWidget(settings *Settings) *Widget {
|
||||
}
|
||||
|
||||
func (widget *Widget) setList() {
|
||||
currenciesMap, _ := wtf.Config.Map("wtf.mods.cryptolive.currencies")
|
||||
|
||||
widget.list = &list{}
|
||||
|
||||
for symbol, currency := range widget.settings.currencies {
|
||||
toList := widget.getToList(symbol)
|
||||
widget.list.addItem(symbol, currency.displayName, toList)
|
||||
for currency := range currenciesMap {
|
||||
displayName, _ := wtf.Config.String("wtf.mods.cryptolive.currencies." + currency + ".displayName")
|
||||
toList := getToList(currency)
|
||||
widget.list.addItem(currency, displayName, toList)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
// Refresh & update after interval time
|
||||
func (widget *Widget) Refresh(wg *sync.WaitGroup) {
|
||||
if len(widget.list.items) != 0 {
|
||||
widget.updateCurrencies()
|
||||
if !ok {
|
||||
widget.Result = "Please check your internet connection"
|
||||
} else {
|
||||
widget.display()
|
||||
}
|
||||
if len(widget.list.items) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
widget.updateCurrencies()
|
||||
|
||||
if !ok {
|
||||
widget.Result = fmt.Sprint("Please check your internet connection!")
|
||||
return
|
||||
}
|
||||
widget.display()
|
||||
wg.Done()
|
||||
}
|
||||
|
||||
@ -60,23 +66,16 @@ func (widget *Widget) Refresh(wg *sync.WaitGroup) {
|
||||
|
||||
func (widget *Widget) display() {
|
||||
str := ""
|
||||
|
||||
var (
|
||||
fromNameColor = wtf.Config.UString("wtf.mods.cryptolive.colors.from.name", "coral")
|
||||
fromDisplayNameColor = wtf.Config.UString("wtf.mods.cryptolive.colors.from.displayName", "grey")
|
||||
toNameColor = wtf.Config.UString("wtf.mods.cryptolive.colors.to.name", "white")
|
||||
toPriceColor = wtf.Config.UString("wtf.mods.cryptolive.colors.to.price", "green")
|
||||
)
|
||||
for _, item := range widget.list.items {
|
||||
str += fmt.Sprintf(
|
||||
" [%s]%s[%s] (%s)\n",
|
||||
widget.settings.colors.from.name,
|
||||
item.displayName,
|
||||
widget.settings.colors.from.name,
|
||||
item.name,
|
||||
)
|
||||
str += fmt.Sprintf(" [%s]%s[%s] (%s)\n", fromNameColor, item.displayName, fromDisplayNameColor, item.name)
|
||||
for _, toItem := range item.to {
|
||||
str += fmt.Sprintf(
|
||||
"\t[%s]%s: [%s]%f\n",
|
||||
widget.settings.colors.to.name,
|
||||
toItem.name,
|
||||
widget.settings.colors.to.price,
|
||||
toItem.price,
|
||||
)
|
||||
str += fmt.Sprintf("\t[%s]%s: [%s]%f\n", toNameColor, toItem.name, toPriceColor, toItem.price)
|
||||
}
|
||||
str += "\n"
|
||||
}
|
||||
@ -84,10 +83,12 @@ func (widget *Widget) display() {
|
||||
widget.Result = fmt.Sprintf("\n%s", str)
|
||||
}
|
||||
|
||||
func (widget *Widget) getToList(symbol string) []*toCurrency {
|
||||
func getToList(fromName string) []*toCurrency {
|
||||
toNames, _ := wtf.Config.List("wtf.mods.cryptolive.currencies." + fromName + ".to")
|
||||
|
||||
var toList []*toCurrency
|
||||
|
||||
for _, to := range widget.settings.currencies[symbol].to {
|
||||
for _, to := range toNames {
|
||||
toList = append(toList, &toCurrency{
|
||||
name: to.(string),
|
||||
price: 0,
|
||||
@ -99,9 +100,7 @@ func (widget *Widget) getToList(symbol string) []*toCurrency {
|
||||
|
||||
func (widget *Widget) updateCurrencies() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
fmt.Println("recovered in updateSummary()", r)
|
||||
}
|
||||
recover()
|
||||
}()
|
||||
for _, fromCurrency := range widget.list.items {
|
||||
|
||||
@ -111,7 +110,7 @@ func (widget *Widget) updateCurrencies() {
|
||||
)
|
||||
|
||||
client = http.Client{
|
||||
Timeout: 5 * time.Second,
|
||||
Timeout: time.Duration(5 * time.Second),
|
||||
}
|
||||
|
||||
request := makeRequest(fromCurrency)
|
||||
@ -123,22 +122,27 @@ func (widget *Widget) updateCurrencies() {
|
||||
ok = true
|
||||
}
|
||||
|
||||
defer func() { _ = response.Body.Close() }()
|
||||
defer response.Body.Close()
|
||||
|
||||
_ = json.NewDecoder(response.Body).Decode(&jsonResponse)
|
||||
|
||||
setPrices(&jsonResponse, fromCurrency)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func makeRequest(currency *fromCurrency) *http.Request {
|
||||
fsym := currency.name
|
||||
tsyms := ""
|
||||
for _, to := range currency.to {
|
||||
tsyms += fmt.Sprintf("%s,", to.name)
|
||||
}
|
||||
|
||||
url := fmt.Sprintf("%s?fsym=%s&tsyms=%s", baseURL, currency.name, tsyms)
|
||||
request, _ := http.NewRequest("GET", url, nil)
|
||||
url := fmt.Sprintf("%s?fsym=%s&tsyms=%s", baseURL, fsym, tsyms)
|
||||
request, err := http.NewRequest("GET", url, nil)
|
||||
|
||||
if err != nil {
|
||||
}
|
||||
|
||||
return request
|
||||
}
|
55
cryptoexchanges/cryptolive/toplist/display.go
Normal file
55
cryptoexchanges/cryptolive/toplist/display.go
Normal file
@ -0,0 +1,55 @@
|
||||
package toplist
|
||||
|
||||
import "fmt"
|
||||
|
||||
func (widget *Widget) display() {
|
||||
str := ""
|
||||
for _, fromCurrency := range widget.list.items {
|
||||
str += fmt.Sprintf(
|
||||
"[%s]%s [%s](%s)\n",
|
||||
widget.colors.from.displayName,
|
||||
fromCurrency.displayName,
|
||||
widget.colors.from.name,
|
||||
fromCurrency.name,
|
||||
)
|
||||
str += makeToListText(fromCurrency.to, widget.colors)
|
||||
}
|
||||
|
||||
widget.Result = str
|
||||
}
|
||||
|
||||
func makeToListText(toList []*tCurrency, colors textColors) string {
|
||||
str := ""
|
||||
for _, toCurrency := range toList {
|
||||
str += makeToText(toCurrency, colors)
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
func makeToText(toCurrency *tCurrency, colors textColors) string {
|
||||
str := ""
|
||||
str += fmt.Sprintf(" [%s]%s\n", colors.to.name, toCurrency.name)
|
||||
for _, info := range toCurrency.info {
|
||||
str += makeInfoText(info, colors)
|
||||
str += "\n\n"
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
func makeInfoText(info tInfo, colors textColors) string {
|
||||
return fmt.Sprintf(
|
||||
" [%s]Exchange: [%s]%s\n",
|
||||
colors.to.field,
|
||||
colors.to.value,
|
||||
info.exchange,
|
||||
) +
|
||||
fmt.Sprintf(
|
||||
" [%s]Volume(24h): [%s]%f-[%s]%f",
|
||||
colors.to.field,
|
||||
colors.to.value,
|
||||
info.volume24h,
|
||||
colors.to.value,
|
||||
info.volume24hTo,
|
||||
)
|
||||
}
|
@ -7,43 +7,62 @@ import (
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
var baseURL = "https://min-api.cryptocompare.com/data/top/exchanges"
|
||||
|
||||
type textColors struct {
|
||||
from struct {
|
||||
name string
|
||||
displayName string
|
||||
}
|
||||
to struct {
|
||||
name string
|
||||
field string
|
||||
value string
|
||||
}
|
||||
}
|
||||
|
||||
// Widget Toplist Widget
|
||||
type Widget struct {
|
||||
Result string
|
||||
|
||||
RefreshInterval int
|
||||
|
||||
list *cList
|
||||
settings *Settings
|
||||
list *cList
|
||||
|
||||
colors textColors
|
||||
}
|
||||
|
||||
// NewWidget Make new toplist widget
|
||||
func NewWidget(settings *Settings) *Widget {
|
||||
widget := Widget{
|
||||
settings: settings,
|
||||
}
|
||||
func NewWidget() *Widget {
|
||||
widget := Widget{}
|
||||
|
||||
widget.list = &cList{}
|
||||
widget.setList()
|
||||
widget.config()
|
||||
|
||||
return &widget
|
||||
}
|
||||
|
||||
func (widget *Widget) setList() {
|
||||
for symbol, currency := range widget.settings.top {
|
||||
toList := widget.makeToList(symbol, currency.limit)
|
||||
widget.list.addItem(symbol, currency.displayName, currency.limit, toList)
|
||||
currenciesMap, _ := wtf.Config.Map("wtf.mods.cryptolive.top")
|
||||
|
||||
for fromCurrency := range currenciesMap {
|
||||
displayName := wtf.Config.UString("wtf.mods.cryptolive.top."+fromCurrency+".displayName", "")
|
||||
limit := wtf.Config.UInt("wtf.mods.cryptolive.top."+fromCurrency+".limit", 1)
|
||||
widget.list.addItem(fromCurrency, displayName, limit, makeToList(fromCurrency, limit))
|
||||
}
|
||||
}
|
||||
|
||||
func (widget *Widget) makeToList(symbol string, limit int) (list []*tCurrency) {
|
||||
for _, to := range widget.settings.top[symbol].to {
|
||||
func makeToList(fCurrencyName string, limit int) (list []*tCurrency) {
|
||||
toList, _ := wtf.Config.List("wtf.mods.cryptolive.top." + fCurrencyName + ".to")
|
||||
|
||||
for _, toCurrency := range toList {
|
||||
list = append(list, &tCurrency{
|
||||
name: to.(string),
|
||||
name: toCurrency.(string),
|
||||
info: make([]tInfo, limit),
|
||||
})
|
||||
}
|
||||
@ -51,16 +70,26 @@ func (widget *Widget) makeToList(symbol string, limit int) (list []*tCurrency) {
|
||||
return
|
||||
}
|
||||
|
||||
func (widget *Widget) config() {
|
||||
// set colors
|
||||
widget.colors.from.name = wtf.Config.UString("wtf.mods.cryptolive.colors.top.from.name", "coral")
|
||||
widget.colors.from.displayName = wtf.Config.UString("wtf.mods.cryptolive.colors.top.from.displayName", "grey")
|
||||
widget.colors.to.name = wtf.Config.UString("wtf.mods.cryptolive.colors.top.to.name", "red")
|
||||
widget.colors.to.field = wtf.Config.UString("wtf.mods.cryptolive.colors.top.to.field", "white")
|
||||
widget.colors.to.value = wtf.Config.UString("wtf.mods.cryptolive.colors.top.to.value", "value")
|
||||
}
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
// Refresh & update after interval time
|
||||
func (widget *Widget) Refresh(wg *sync.WaitGroup) {
|
||||
if len(widget.list.items) != 0 {
|
||||
|
||||
widget.updateData()
|
||||
|
||||
widget.display()
|
||||
if len(widget.list.items) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
widget.updateData()
|
||||
|
||||
widget.display()
|
||||
wg.Done()
|
||||
}
|
||||
|
||||
@ -68,13 +97,11 @@ func (widget *Widget) Refresh(wg *sync.WaitGroup) {
|
||||
|
||||
func (widget *Widget) updateData() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
fmt.Println("recovered in updateSummary()", r)
|
||||
}
|
||||
recover()
|
||||
}()
|
||||
|
||||
client := &http.Client{
|
||||
Timeout: 5 * time.Second,
|
||||
Timeout: time.Duration(5 * time.Second),
|
||||
}
|
||||
|
||||
for _, fromCurrency := range widget.list.items {
|
@ -5,28 +5,24 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/rivo/tview"
|
||||
"github.com/wtfutil/wtf/modules/cryptoexchanges/cryptolive/price"
|
||||
"github.com/wtfutil/wtf/modules/cryptoexchanges/cryptolive/toplist"
|
||||
"github.com/wtfutil/wtf/view"
|
||||
"github.com/wtfutil/wtf/cryptoexchanges/cryptolive/price"
|
||||
"github.com/wtfutil/wtf/cryptoexchanges/cryptolive/toplist"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
// Widget define wtf widget to register widget later
|
||||
type Widget struct {
|
||||
view.TextWidget
|
||||
|
||||
wtf.TextWidget
|
||||
priceWidget *price.Widget
|
||||
toplistWidget *toplist.Widget
|
||||
settings *Settings
|
||||
}
|
||||
|
||||
// NewWidget Make new instance of widget
|
||||
func NewWidget(tviewApp *tview.Application, settings *Settings) *Widget {
|
||||
func NewWidget(app *tview.Application) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: view.NewTextWidget(tviewApp, nil, settings.Common),
|
||||
|
||||
priceWidget: price.NewWidget(settings.priceSettings),
|
||||
toplistWidget: toplist.NewWidget(settings.toplistSettings),
|
||||
settings: settings,
|
||||
TextWidget: wtf.NewTextWidget(app, "CryptoLive", "cryptolive", false),
|
||||
priceWidget: price.NewWidget(),
|
||||
toplistWidget: toplist.NewWidget(),
|
||||
}
|
||||
|
||||
widget.priceWidget.RefreshInterval = widget.RefreshInterval()
|
||||
@ -46,15 +42,14 @@ func (widget *Widget) Refresh() {
|
||||
widget.toplistWidget.Refresh(&wg)
|
||||
wg.Wait()
|
||||
|
||||
widget.Redraw(widget.content)
|
||||
display(widget)
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) content() (string, string, bool) {
|
||||
func display(widget *Widget) {
|
||||
str := ""
|
||||
str += widget.priceWidget.Result
|
||||
str += widget.toplistWidget.Result
|
||||
|
||||
return widget.CommonSettings().Title, fmt.Sprintf("\n%s", str), false
|
||||
widget.View.SetText(fmt.Sprintf("\n%s", str))
|
||||
}
|
34
datadog/client.go
Normal file
34
datadog/client.go
Normal file
@ -0,0 +1,34 @@
|
||||
package datadog
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
datadog "github.com/zorkian/go-datadog-api"
|
||||
)
|
||||
|
||||
// Monitors returns a list of newrelic monitors
|
||||
func Monitors() ([]datadog.Monitor, error) {
|
||||
client := datadog.NewClient(apiKey(), applicationKey())
|
||||
|
||||
monitors, err := client.GetMonitorsByTags(wtf.ToStrs(wtf.Config.UList("wtf.mods.datadog.monitors.tags")))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return monitors, nil
|
||||
}
|
||||
|
||||
func apiKey() string {
|
||||
return wtf.Config.UString(
|
||||
"wtf.mods.datadog.apiKey",
|
||||
os.Getenv("WTF_DATADOG_API_KEY"),
|
||||
)
|
||||
}
|
||||
|
||||
func applicationKey() string {
|
||||
return wtf.Config.UString(
|
||||
"wtf.mods.datadog.applicationKey",
|
||||
os.Getenv("WTF_DATADOG_APPLICATION_KEY"),
|
||||
)
|
||||
}
|
73
datadog/widget.go
Normal file
73
datadog/widget.go
Normal file
@ -0,0 +1,73 @@
|
||||
package datadog
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/rivo/tview"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
datadog "github.com/zorkian/go-datadog-api"
|
||||
)
|
||||
|
||||
type Widget struct {
|
||||
wtf.TextWidget
|
||||
}
|
||||
|
||||
func NewWidget(app *tview.Application) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(app, "Datadog", "datadog", false),
|
||||
}
|
||||
|
||||
return &widget
|
||||
}
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
monitors, monitorErr := Monitors()
|
||||
|
||||
widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s", widget.Name)))
|
||||
widget.View.Clear()
|
||||
|
||||
var content string
|
||||
if monitorErr != nil {
|
||||
widget.View.SetWrap(true)
|
||||
content = monitorErr.Error()
|
||||
} else {
|
||||
widget.View.SetWrap(false)
|
||||
content = widget.contentFrom(monitors)
|
||||
}
|
||||
|
||||
widget.View.SetText(content)
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) contentFrom(monitors []datadog.Monitor) string {
|
||||
var str string
|
||||
|
||||
triggeredMonitors := []datadog.Monitor{}
|
||||
|
||||
for _, monitor := range monitors {
|
||||
state := *monitor.OverallState
|
||||
switch state {
|
||||
case "Alert":
|
||||
triggeredMonitors = append(triggeredMonitors, monitor)
|
||||
}
|
||||
}
|
||||
if len(triggeredMonitors) > 0 {
|
||||
str = str + fmt.Sprintf(
|
||||
" %s\n",
|
||||
"[red]Triggered Monitors[white]",
|
||||
)
|
||||
for _, triggeredMonitor := range triggeredMonitors {
|
||||
str = str + fmt.Sprintf("[red] %s\n", *triggeredMonitor.Name)
|
||||
}
|
||||
} else {
|
||||
str = str + fmt.Sprintf(
|
||||
" %s\n",
|
||||
"[green]No Triggered Monitors[white]",
|
||||
)
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
120
flags/flags.go
120
flags/flags.go
@ -4,42 +4,19 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/chzyer/readline"
|
||||
goFlags "github.com/jessevdk/go-flags"
|
||||
"github.com/olebedev/config"
|
||||
"github.com/wtfutil/wtf/cfg"
|
||||
"github.com/wtfutil/wtf/help"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
// Flags is the container for command line flag data
|
||||
type Flags struct {
|
||||
Config string `short:"c" long:"config" optional:"yes" description:"Path to config file"`
|
||||
Module string `short:"m" long:"module" optional:"yes" description:"Display info about a specific module, i.e.: 'wtfutil -m=todo'"`
|
||||
Module string `short:"m" long:"module" optional:"yes" description:"Display info about a specific module, i.e.: 'wtf -m=todo'"`
|
||||
Profile bool `short:"p" long:"profile" optional:"yes" description:"Profile application memory usage"`
|
||||
Version bool `short:"v" long:"version" description:"Show version info"`
|
||||
// Work-around go-flags misfeatures. If any sub-command is defined
|
||||
// then `wtf` (no sub-commands, the common usage), is warned about.
|
||||
Opt struct {
|
||||
Cmd string `positional-arg-name:"command"`
|
||||
Args []string `positional-arg-name:"args"`
|
||||
} `positional-args:"yes"`
|
||||
|
||||
hasCustom bool
|
||||
}
|
||||
|
||||
var EXTRA = `
|
||||
Commands:
|
||||
save-secret <service>
|
||||
service Service URL or module name of secret.
|
||||
Save a secret into the secret store. The secret will be prompted for.
|
||||
Requires wtf.secretStore to be configured. See individual modules for
|
||||
information on what service and secret means for their configuration,
|
||||
not all modules use secrets.
|
||||
`
|
||||
|
||||
// NewFlags creates an instance of Flags
|
||||
func NewFlags() *Flags {
|
||||
flags := Flags{}
|
||||
return &flags
|
||||
@ -47,114 +24,51 @@ func NewFlags() *Flags {
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
// ConfigFilePath returns the path to the currently-loaded config file
|
||||
func (flags *Flags) ConfigFilePath() string {
|
||||
return flags.Config
|
||||
}
|
||||
|
||||
// RenderIf displays special-case information based on the flags passed
|
||||
// in, if any flags were passed in
|
||||
func (flags *Flags) RenderIf(version, date string, config *config.Config) {
|
||||
func (flags *Flags) Display(version string) {
|
||||
if flags.HasModule() {
|
||||
help.Display(flags.Module, config)
|
||||
help.Display(flags.Module)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
if flags.HasVersion() {
|
||||
fmt.Printf("%s (%s)\n", version, date)
|
||||
fmt.Println(version)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
if flags.Opt.Cmd == "" {
|
||||
return
|
||||
}
|
||||
|
||||
switch cmd := flags.Opt.Cmd; cmd {
|
||||
case "save-secret":
|
||||
var service, secret string
|
||||
args := flags.Opt.Args
|
||||
|
||||
if len(args) < 1 || args[0] == "" {
|
||||
fmt.Fprintf(os.Stderr, "save-secret: service required, see `%s --help`\n", os.Args[0])
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
service = args[0]
|
||||
|
||||
if len(args) > 1 {
|
||||
fmt.Fprintf(os.Stderr, "save-secret: too many arguments, see `%s --help`\n", os.Args[0])
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
b, err := readline.Password("Secret: ")
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
secret = string(b)
|
||||
secret = strings.TrimSpace(secret)
|
||||
|
||||
if secret == "" {
|
||||
fmt.Fprintf(os.Stderr, "save-secret: secret required, see `%s --help`\n", os.Args[0])
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
err = cfg.StoreSecret(config, &cfg.Secret{
|
||||
Service: service,
|
||||
Secret: secret,
|
||||
Username: "default",
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Saving secret for service %q: %s\n", service, err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
fmt.Printf("Saved secret for service %q\n", service)
|
||||
os.Exit(0)
|
||||
default:
|
||||
fmt.Fprintf(os.Stderr, "Command `%s` is not supported, try `%s --help`\n", cmd, os.Args[0])
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
// HasCustomConfig returns TRUE if a config path was passed in, FALSE if one was not
|
||||
func (flags *Flags) HasCustomConfig() bool {
|
||||
return flags.hasCustom
|
||||
func (flags *Flags) HasConfig() bool {
|
||||
return len(flags.Config) > 0
|
||||
}
|
||||
|
||||
// HasModule returns TRUE if a module name was passed in, FALSE if one was not
|
||||
func (flags *Flags) HasModule() bool {
|
||||
return len(flags.Module) > 0
|
||||
}
|
||||
|
||||
// HasVersion returns TRUE if the version flag was passed in, FALSE if it was not
|
||||
func (flags *Flags) HasVersion() bool {
|
||||
return flags.Version
|
||||
return flags.Version == true
|
||||
}
|
||||
|
||||
// Parse parses the incoming flags
|
||||
func (flags *Flags) Parse() {
|
||||
parser := goFlags.NewParser(flags, goFlags.Default)
|
||||
if _, err := parser.Parse(); err != nil {
|
||||
if flagsErr, ok := err.(*goFlags.Error); ok && flagsErr.Type == goFlags.ErrHelp {
|
||||
fmt.Println(EXTRA)
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
|
||||
// If we have a custom config, then we're done parsing parameters, we don't need to
|
||||
// generate the default value
|
||||
flags.hasCustom = (len(flags.Config) > 0)
|
||||
if flags.hasCustom {
|
||||
return
|
||||
}
|
||||
// If no config file is explicitly passed in as a param,
|
||||
// set the flag to the default config file
|
||||
if !flags.HasConfig() {
|
||||
homeDir, err := wtf.Home()
|
||||
if err != nil {
|
||||
fmt.Printf("Error: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// If no config file is explicitly passed in as a param then set the flag to the default config file
|
||||
configDir, err := cfg.WtfConfigDir()
|
||||
if err != nil {
|
||||
fmt.Printf("Error: %v\n", err)
|
||||
os.Exit(1)
|
||||
flags.Config = filepath.Join(homeDir, ".config", "wtf", "config.yml")
|
||||
}
|
||||
flags.Config = filepath.Join(configDir, "config.yml")
|
||||
}
|
||||
|
@ -1,10 +1,9 @@
|
||||
package gcal
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/wtfutil/wtf/utils"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
"google.golang.org/api/calendar/v3"
|
||||
)
|
||||
|
||||
@ -53,7 +52,7 @@ func (calEvent *CalEvent) Past() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
return !calEvent.Now() && calEvent.Start().Before(time.Now())
|
||||
return (calEvent.Now() == false) && calEvent.Start().Before(time.Now())
|
||||
}
|
||||
|
||||
func (calEvent *CalEvent) ResponseFor(email string) string {
|
||||
@ -98,23 +97,12 @@ func (calEvent *CalEvent) Start() time.Time {
|
||||
return start
|
||||
}
|
||||
|
||||
func (calEvent *CalEvent) Timestamp(hourFormat string, showEndTime bool) string {
|
||||
func (calEvent *CalEvent) Timestamp() string {
|
||||
if calEvent.AllDay() {
|
||||
startTime, _ := time.ParseInLocation("2006-01-02", calEvent.event.Start.Date, time.Local)
|
||||
return startTime.Format(utils.FriendlyDateFormat)
|
||||
return startTime.Format(wtf.FriendlyDateFormat)
|
||||
}
|
||||
|
||||
startTime, _ := time.Parse(time.RFC3339, calEvent.event.Start.DateTime)
|
||||
endTime, _ := time.Parse(time.RFC3339, calEvent.event.End.DateTime)
|
||||
|
||||
timeFormat := utils.MinimumTimeFormat24
|
||||
if hourFormat == "12" {
|
||||
timeFormat = utils.MinimumTimeFormat12
|
||||
}
|
||||
|
||||
if showEndTime {
|
||||
return fmt.Sprintf("%s-%s", startTime.Format(timeFormat), endTime.Format(timeFormat))
|
||||
}
|
||||
|
||||
return startTime.Format(timeFormat)
|
||||
return startTime.Format(wtf.MinimumTimeFormat)
|
||||
}
|
@ -15,26 +15,24 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/wtfutil/wtf/cfg"
|
||||
"github.com/wtfutil/wtf/utils"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
"golang.org/x/oauth2"
|
||||
"golang.org/x/oauth2/google"
|
||||
"google.golang.org/api/calendar/v3"
|
||||
"google.golang.org/api/option"
|
||||
)
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) Fetch() ([]*CalEvent, error) {
|
||||
func Fetch() ([]*CalEvent, error) {
|
||||
ctx := context.Background()
|
||||
|
||||
secretPath, _ := utils.ExpandHomeDir(widget.settings.secretFile)
|
||||
secretPath, _ := wtf.ExpandHomeDir(wtf.Config.UString("wtf.mods.gcal.secretFile"))
|
||||
|
||||
b, err := ioutil.ReadFile(filepath.Clean(secretPath))
|
||||
b, err := ioutil.ReadFile(secretPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -45,23 +43,22 @@ func (widget *Widget) Fetch() ([]*CalEvent, error) {
|
||||
}
|
||||
client := getClient(ctx, config)
|
||||
|
||||
srv, err := calendar.NewService(context.Background(), option.WithHTTPClient(client))
|
||||
srv, err := calendar.New(client)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
calendarIds, err := getCalendarIdList(srv)
|
||||
|
||||
// Get calendar events
|
||||
var events calendar.Events
|
||||
|
||||
startTime := fromMidnight().Format(time.RFC3339)
|
||||
eventLimit := int64(widget.settings.eventCount)
|
||||
eventLimit := int64(wtf.Config.UInt("wtf.mods.gcal.eventCount", 10))
|
||||
|
||||
timezone := widget.settings.timezone
|
||||
|
||||
calendarIDs, err := widget.getCalendarIdList(srv)
|
||||
for _, calendarID := range calendarIDs {
|
||||
calendarEvents, listErr := srv.Events.List(calendarID).TimeZone(timezone).ShowDeleted(false).TimeMin(startTime).MaxResults(eventLimit).SingleEvents(true).OrderBy("startTime").Do()
|
||||
if listErr != nil {
|
||||
for _, calendarId := range calendarIds {
|
||||
calendarEvents, err := srv.Events.List(calendarId).ShowDeleted(false).TimeMin(startTime).MaxResults(eventLimit).SingleEvents(true).OrderBy("startTime").Do()
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
events.Items = append(events.Items, calendarEvents.Items...)
|
||||
@ -125,17 +122,18 @@ func isAuthenticated() bool {
|
||||
return err == nil
|
||||
}
|
||||
|
||||
func (widget *Widget) authenticate() {
|
||||
secretPath, _ := utils.ExpandHomeDir(filepath.Clean(widget.settings.secretFile))
|
||||
func authenticate() {
|
||||
filename := wtf.Config.UString("wtf.mods.gcal.secretFile")
|
||||
secretPath, _ := wtf.ExpandHomeDir(filename)
|
||||
|
||||
b, err := ioutil.ReadFile(filepath.Clean(secretPath))
|
||||
b, err := ioutil.ReadFile(secretPath)
|
||||
if err != nil {
|
||||
log.Fatalf("Unable to read secret file. %v", widget.settings.secretFile)
|
||||
log.Fatalf("Unable to read secret file. %v", filename)
|
||||
}
|
||||
|
||||
config, _ := google.ConfigFromJSON(b, calendar.CalendarReadonlyScope)
|
||||
config, err := google.ConfigFromJSON(b, calendar.CalendarReadonlyScope)
|
||||
tok := getTokenFromWeb(config)
|
||||
cacheFile, _ := tokenCacheFile()
|
||||
cacheFile, err := tokenCacheFile()
|
||||
saveToken(cacheFile, tok)
|
||||
}
|
||||
|
||||
@ -151,7 +149,7 @@ func getTokenFromWeb(config *oauth2.Config) *oauth2.Token {
|
||||
log.Fatalf("Unable to read authorization code %v", err)
|
||||
}
|
||||
|
||||
tok, err := config.Exchange(context.Background(), code)
|
||||
tok, err := config.Exchange(oauth2.NoContext, code)
|
||||
if err != nil {
|
||||
log.Fatalf("Unable to retrieve token from web %v", err)
|
||||
}
|
||||
@ -167,14 +165,13 @@ func tokenCacheFile() (string, error) {
|
||||
// tokenFromFile retrieves a Token from a given file path.
|
||||
// It returns the retrieved Token and any read error encountered.
|
||||
func tokenFromFile(file string) (*oauth2.Token, error) {
|
||||
f, err := os.Open(filepath.Clean(file))
|
||||
f, err := os.Open(file)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
t := &oauth2.Token{}
|
||||
err = json.NewDecoder(f).Decode(t)
|
||||
defer func() { _ = f.Close() }()
|
||||
|
||||
defer f.Close()
|
||||
return t, err
|
||||
}
|
||||
|
||||
@ -184,19 +181,16 @@ func saveToken(file string, token *oauth2.Token) {
|
||||
fmt.Printf("Saving credential file to: %s\n", file)
|
||||
f, err := os.OpenFile(file, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
|
||||
if err != nil {
|
||||
log.Fatalf("unable to cache oauth token: %v", err)
|
||||
log.Fatalf("Unable to cache oauth token: %v", err)
|
||||
}
|
||||
defer func() { _ = f.Close() }()
|
||||
defer f.Close()
|
||||
|
||||
err = json.NewEncoder(f).Encode(token)
|
||||
if err != nil {
|
||||
log.Fatalf("unable to encode oauth token: %v", err)
|
||||
}
|
||||
json.NewEncoder(f).Encode(token)
|
||||
}
|
||||
|
||||
func (widget *Widget) getCalendarIdList(srv *calendar.Service) ([]string, error) {
|
||||
func getCalendarIdList(srv *calendar.Service) ([]string, error) {
|
||||
// Return single calendar if settings specify we should
|
||||
if !widget.settings.multiCalendar {
|
||||
if !wtf.Config.UBool("wtf.mods.gcal.multiCalendar", false) {
|
||||
id, err := srv.CalendarList.Get("primary").Do()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -208,7 +202,7 @@ func (widget *Widget) getCalendarIdList(srv *calendar.Service) ([]string, error)
|
||||
var calendarIds []string
|
||||
var pageToken string
|
||||
for {
|
||||
calendarList, err := srv.CalendarList.List().ShowHidden(false).MinAccessRole(widget.settings.calendarReadLevel).PageToken(pageToken).Do()
|
||||
calendarList, err := srv.CalendarList.List().ShowHidden(false).MinAccessRole("writer").PageToken(pageToken).Do()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
@ -6,44 +6,55 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/wtfutil/wtf/utils"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
func (widget *Widget) display() {
|
||||
widget.Redraw(widget.content)
|
||||
}
|
||||
func (widget *Widget) sortedEvents() ([]*CalEvent, []*CalEvent) {
|
||||
allDayEvents := []*CalEvent{}
|
||||
timedEvents := []*CalEvent{}
|
||||
|
||||
func (widget *Widget) content() (string, string, bool) {
|
||||
title := widget.settings.Title
|
||||
calEvents := widget.calEvents
|
||||
|
||||
if widget.err != nil {
|
||||
return title, widget.err.Error(), true
|
||||
for _, calEvent := range widget.calEvents {
|
||||
if calEvent.AllDay() {
|
||||
allDayEvents = append(allDayEvents, calEvent)
|
||||
} else {
|
||||
timedEvents = append(timedEvents, calEvent)
|
||||
}
|
||||
}
|
||||
|
||||
return allDayEvents, timedEvents
|
||||
}
|
||||
|
||||
func (widget *Widget) display() {
|
||||
if widget.calEvents == nil || len(widget.calEvents) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
widget.mutex.Lock()
|
||||
defer widget.mutex.Unlock()
|
||||
|
||||
widget.View.SetTitle(widget.ContextualTitle(widget.Name))
|
||||
widget.View.SetText(widget.contentFrom(widget.calEvents))
|
||||
}
|
||||
|
||||
func (widget *Widget) contentFrom(calEvents []*CalEvent) string {
|
||||
if (calEvents == nil) || (len(calEvents) == 0) {
|
||||
return title, "No calendar events", false
|
||||
return ""
|
||||
}
|
||||
|
||||
var str string
|
||||
var prevEvent *CalEvent
|
||||
|
||||
if !widget.settings.showDeclined {
|
||||
calEvents = widget.removeDeclined(calEvents)
|
||||
if !wtf.Config.UBool("wtf.mods.gcal.showDeclined", false) {
|
||||
calEvents = removeDeclined(calEvents)
|
||||
}
|
||||
|
||||
for _, calEvent := range calEvents {
|
||||
if calEvent.AllDay() && !widget.settings.showAllDay {
|
||||
continue
|
||||
}
|
||||
|
||||
ts := calEvent.Timestamp(widget.settings.hourFormat, widget.settings.showEndTime)
|
||||
timestamp := fmt.Sprintf("[%s]%s", widget.eventTimeColor(calEvent), ts)
|
||||
timestamp := fmt.Sprintf("[%s]%s", widget.descriptionColor(calEvent), calEvent.Timestamp())
|
||||
if calEvent.AllDay() {
|
||||
timestamp = ""
|
||||
}
|
||||
|
||||
eventTitle := fmt.Sprintf("[%s]%s",
|
||||
title := fmt.Sprintf("[%s]%s",
|
||||
widget.titleColor(calEvent),
|
||||
widget.eventSummary(calEvent, calEvent.ConflictsWith(calEvents)),
|
||||
)
|
||||
@ -53,23 +64,23 @@ func (widget *Widget) content() (string, string, bool) {
|
||||
widget.dayDivider(calEvent, prevEvent),
|
||||
widget.responseIcon(calEvent),
|
||||
timestamp,
|
||||
eventTitle,
|
||||
title,
|
||||
)
|
||||
|
||||
str += fmt.Sprintf("%s %s%s\n",
|
||||
str = str + fmt.Sprintf("%s %s%s\n",
|
||||
lineOne,
|
||||
widget.location(calEvent),
|
||||
widget.timeUntil(calEvent),
|
||||
)
|
||||
|
||||
if (widget.location(calEvent) != "") || (widget.timeUntil(calEvent) != "") {
|
||||
str += "\n"
|
||||
str = str + "\n"
|
||||
}
|
||||
|
||||
prevEvent = calEvent
|
||||
}
|
||||
|
||||
return title, str, false
|
||||
return str
|
||||
}
|
||||
|
||||
func (widget *Widget) dayDivider(event, prevEvent *CalEvent) string {
|
||||
@ -88,9 +99,10 @@ func (widget *Widget) dayDivider(event, prevEvent *CalEvent) string {
|
||||
eventStartDay := toMidnight(event.Start())
|
||||
|
||||
if !eventStartDay.Equal(prevStartDay) {
|
||||
return fmt.Sprintf("[%s]",
|
||||
widget.settings.colors.day) +
|
||||
event.Start().Format(utils.FullDateFormat) +
|
||||
|
||||
return fmt.Sprintf("[%s::b]",
|
||||
wtf.Config.UString("wtf.mods.gcal.colors.day", "forestgreen")) +
|
||||
event.Start().Format(wtf.FullDateFormat) +
|
||||
"\n"
|
||||
}
|
||||
|
||||
@ -99,14 +111,10 @@ func (widget *Widget) dayDivider(event, prevEvent *CalEvent) string {
|
||||
|
||||
func (widget *Widget) descriptionColor(calEvent *CalEvent) string {
|
||||
if calEvent.Past() {
|
||||
return widget.settings.colors.past
|
||||
return wtf.Config.UString("wtf.mods.gcal.colors.past", "gray")
|
||||
}
|
||||
|
||||
return widget.settings.colors.description
|
||||
}
|
||||
|
||||
func (widget *Widget) eventTimeColor(calEvent *CalEvent) string {
|
||||
return widget.settings.colors.eventTime
|
||||
return wtf.Config.UString("wtf.mods.gcal.colors.description", "white")
|
||||
}
|
||||
|
||||
func (widget *Widget) eventSummary(calEvent *CalEvent, conflict bool) string {
|
||||
@ -115,13 +123,13 @@ func (widget *Widget) eventSummary(calEvent *CalEvent, conflict bool) string {
|
||||
if calEvent.Now() {
|
||||
summary = fmt.Sprintf(
|
||||
"%s %s",
|
||||
widget.settings.currentIcon,
|
||||
wtf.Config.UString("wtf.mods.gcal.currentIcon", "🔸"),
|
||||
summary,
|
||||
)
|
||||
}
|
||||
|
||||
if conflict {
|
||||
return fmt.Sprintf("%s %s", widget.settings.conflictIcon, summary)
|
||||
return fmt.Sprintf("%s %s", wtf.Config.UString("wtf.mods.gcal.conflictIcon", "🚨"), summary)
|
||||
}
|
||||
|
||||
return summary
|
||||
@ -147,12 +155,11 @@ func (widget *Widget) timeUntil(calEvent *CalEvent) string {
|
||||
untilStr := ""
|
||||
|
||||
color := "[lightblue]"
|
||||
switch {
|
||||
case days > 0:
|
||||
if days > 0 {
|
||||
untilStr = fmt.Sprintf("%dd", days)
|
||||
case hours > 0:
|
||||
} else if hours > 0 {
|
||||
untilStr = fmt.Sprintf("%dh", hours)
|
||||
default:
|
||||
} else {
|
||||
untilStr = fmt.Sprintf("%dm", mins)
|
||||
if mins < 30 {
|
||||
color = "[red]"
|
||||
@ -163,30 +170,30 @@ func (widget *Widget) timeUntil(calEvent *CalEvent) string {
|
||||
}
|
||||
|
||||
func (widget *Widget) titleColor(calEvent *CalEvent) string {
|
||||
color := widget.settings.colors.title
|
||||
color := wtf.Config.UString("wtf.mods.gcal.colors.title", "white")
|
||||
|
||||
for _, untypedArr := range widget.settings.colors.highlights {
|
||||
highlightElements := utils.ToStrs(untypedArr.([]interface{}))
|
||||
for _, untypedArr := range wtf.Config.UList("wtf.mods.gcal.colors.highlights") {
|
||||
highlightElements := wtf.ToStrs(untypedArr.([]interface{}))
|
||||
|
||||
match, _ := regexp.MatchString(
|
||||
strings.ToLower(highlightElements[0]),
|
||||
strings.ToLower(calEvent.event.Summary),
|
||||
)
|
||||
|
||||
if match {
|
||||
if match == true {
|
||||
color = highlightElements[1]
|
||||
}
|
||||
}
|
||||
|
||||
if calEvent.Past() {
|
||||
color = widget.settings.colors.past
|
||||
color = wtf.Config.UString("wtf.mods.gcal.colors.past", "gray")
|
||||
}
|
||||
|
||||
return color
|
||||
}
|
||||
|
||||
func (widget *Widget) location(calEvent *CalEvent) string {
|
||||
if !widget.settings.withLocation {
|
||||
if wtf.Config.UBool("wtf.mods.gcal.displayLocation", true) == false {
|
||||
return ""
|
||||
}
|
||||
|
||||
@ -202,15 +209,15 @@ func (widget *Widget) location(calEvent *CalEvent) string {
|
||||
}
|
||||
|
||||
func (widget *Widget) responseIcon(calEvent *CalEvent) string {
|
||||
if !widget.settings.displayResponseStatus {
|
||||
if false == wtf.Config.UBool("wtf.mods.gcal.displayResponseStatus", true) {
|
||||
return ""
|
||||
}
|
||||
|
||||
icon := "[gray]"
|
||||
|
||||
switch calEvent.ResponseFor(widget.settings.email) {
|
||||
switch calEvent.ResponseFor(wtf.Config.UString("wtf.mods.gcal.email")) {
|
||||
case "accepted":
|
||||
return icon + "✔"
|
||||
return icon + "✔︎"
|
||||
case "declined":
|
||||
return icon + "✘"
|
||||
case "needsAction":
|
||||
@ -222,10 +229,10 @@ func (widget *Widget) responseIcon(calEvent *CalEvent) string {
|
||||
}
|
||||
}
|
||||
|
||||
func (widget *Widget) removeDeclined(events []*CalEvent) []*CalEvent {
|
||||
func removeDeclined(events []*CalEvent) []*CalEvent {
|
||||
var ret []*CalEvent
|
||||
for _, e := range events {
|
||||
if e.ResponseFor(widget.settings.email) != "declined" {
|
||||
if e.ResponseFor(wtf.Config.UString("wtf.mods.gcal.email")) != "declined" {
|
||||
ret = append(ret, e)
|
||||
}
|
||||
}
|
77
gcal/widget.go
Normal file
77
gcal/widget.go
Normal file
@ -0,0 +1,77 @@
|
||||
package gcal
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/rivo/tview"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
type Widget struct {
|
||||
wtf.TextWidget
|
||||
|
||||
calEvents []*CalEvent
|
||||
ch chan struct{}
|
||||
mutex sync.Mutex
|
||||
app *tview.Application
|
||||
}
|
||||
|
||||
func NewWidget(app *tview.Application) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(app, "Calendar", "gcal", true),
|
||||
ch: make(chan struct{}),
|
||||
app: app,
|
||||
}
|
||||
|
||||
go updateLoop(&widget)
|
||||
|
||||
return &widget
|
||||
}
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) Disable() {
|
||||
close(widget.ch)
|
||||
widget.TextWidget.Disable()
|
||||
}
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
if isAuthenticated() {
|
||||
widget.fetchAndDisplayEvents()
|
||||
return
|
||||
}
|
||||
widget.app.Suspend(authenticate)
|
||||
widget.Refresh()
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) fetchAndDisplayEvents() {
|
||||
calEvents, err := Fetch()
|
||||
if err != nil {
|
||||
widget.calEvents = []*CalEvent{}
|
||||
} else {
|
||||
widget.calEvents = calEvents
|
||||
}
|
||||
widget.display()
|
||||
}
|
||||
|
||||
func updateLoop(widget *Widget) {
|
||||
interval := wtf.Config.UInt("wtf.mods.gcal.textInterval", 30)
|
||||
if interval == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
tick := time.NewTicker(time.Duration(interval) * time.Second)
|
||||
defer tick.Stop()
|
||||
outer:
|
||||
for {
|
||||
select {
|
||||
case <-tick.C:
|
||||
widget.display()
|
||||
case <-widget.ch:
|
||||
break outer
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user