This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fsharpi | |
#I "../../../.nuget/packages/hopac/0.3.21/lib/net45/" | |
#r "Hopac.Platform" | |
#r "Hopac.Core" | |
#r "Hopac" | |
open System.Collections.Generic | |
open Hopac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fsharpi | |
#I "../../.nuget/packages/hopac/0.3.21/lib/net45/" | |
#r "Hopac.Platform" | |
#r "Hopac.Core" | |
#r "Hopac" | |
open System.Collections.Generic | |
open Hopac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[<EntryPoint>] | |
let main argv = | |
try | |
match ParseArgs argv with | |
| Options.NoCommand -> printfn "%s" "Subcommand required!" | |
| Options.Query o -> | |
let client = Client.New o.BaseUrl o.Id o.Key | |
let status = client.q { | |
let! ticket = client.Query o.Query o.From o.To | |
let! status = client.WaitOn ticket |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Link = | |
{ Rel: string; Url: string } | |
static member FromJson(x:JsonObject) = | |
jsonDecoder { | |
let ps = JsonObject.toMap x | |
return { Rel = string (ps.["rel"]); Url = string ps.["url"] } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Argu | |
open Hopac | |
[<EntryPoint>] | |
let main argv = | |
let query = @"_sourceCategory=harbour/container-health" | |
try | |
Args("fss", argv) | |
|> Client.query query | |
|> Client.send |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Argu | |
[<EntryPoint>] | |
let main argv = | |
try | |
Args("fss", argv) | |
|> Client.json "post" @"{ ""foo"": ""bar"" }" | |
|> Client.send | |
|> printfn "%s" | |
with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let cell (x: 'a) : Job<Cell<'a>> = job { | |
let c = {reqCh = Ch (); replyCh = Ch ()} | |
let rec server x = job { | |
let! req = Ch.take c.reqCh | |
match req with | |
| Get -> | |
do! Ch.give c.replyCh x | |
return! server x | |
| Put x -> | |
return! server x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let create (x: 'a) : Job<Cell<'a>> = Job.delay <| fun () -> | |
let c = {reqCh = Ch (); replyCh = Ch ()} | |
let rec server x = | |
Ch.take c.reqCh >>= function | |
| Get -> | |
Ch.give c.replyCh x >>=. server x | |
| Put x -> server x | |
Job.start (server x) >>-. c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> {}; | |
stdenv.mkDerivation rec { | |
name = "harbour-cli"; | |
buildInputs = [ git go glide ]; | |
src = ./.; | |
phases = [ "glidePhase" "testPhase" "buildPhase" ]; | |
token = builtins.getEnv "WORKIVA_PRIVATE_GITHUB_TOKEN"; | |
glidePhase = '' | |
git config --global url."https://${token}:[email protected]/".insteadOf "https://github.com/"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> {}; | |
stdenv.mkDerivation rec { | |
name = "harbour-cli"; | |
buildInputs = [ go glide ]; | |
src = ./.; | |
buildPhase = '' | |
source $stdenv/setup | |
echo "what up" | |
''; |