Skip to content

morikuni/weso

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

weso

CLI for Websocket.

install

Download from Release Page (may not be the latest)

or

go get github.com/morikuni/weso/cmd/weso

Usage

$ cat template.txt
{{define "Name"}}{"name": "{{._1}}"}{{end}}

{{define "Decorate"}}{{._1}}{{._2}}{{._1}}{{end}}

{{define "Twice"}}{{._1}}{{._1}}{{end}}

$ weso -template template.txt ws://echo.websocket.org
> hello
<< hello
> .Name Jack
<< {"name": "Jack"}
> .Decorate *** "I'm Jack"
<< ***I'm Jack***
> .Twice Hello
<< HelloHello

Start line with dot . to use template.

Template

Template file is written in Go's standard template library.

Arguments for template are expanded to ._1, ._2 ... ._N.

License

MIT

Credit

weso uses