Skip to content

Commit

Permalink
Merge pull request #1 from scspideroak/master
Browse files Browse the repository at this point in the history
Make APIs public
  • Loading branch information
bdzim authored Jun 22, 2021
2 parents e6a5350 + 700fd82 commit 0202767
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions cmd/ww/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ const (
msgChunkSize = 32 << 10
)

type header struct {
Name string `json:"name",omitempty`
Size int `json:"size",omitempty`
Type string `json:"type",omitempty`
type Header struct {
Name string `json:"name,omitempty"`
Size int `json:"size,omitempty"`
Type string `json:"type,omitempty"`
}

func receive(args ...string) {
Expand Down Expand Up @@ -51,7 +51,7 @@ func receive(args ...string) {
if err != nil {
fatalf("could not read file header: %v", err)
}
var h header
var h Header
err = json.Unmarshal(buf[:n], &h)
if err != nil {
fatalf("could not decode file header: %v", err)
Expand Down Expand Up @@ -102,7 +102,7 @@ func send(args ...string) {
if err != nil {
fatalf("could not stat file %s: %v", filename, err)
}
h, err := json.Marshal(header{
h, err := json.Marshal(Header{
Name: filepath.Base(filepath.Clean(filename)),
Size: int(info.Size()),
})
Expand Down
2 changes: 1 addition & 1 deletion cmd/ww/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var subcmds = map[string]func(args ...string){
"send": send,
"receive": receive,
"pipe": pipe,
"server": server,
"server": Server,
}

var (
Expand Down
2 changes: 1 addition & 1 deletion cmd/ww/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ func relay(w http.ResponseWriter, r *http.Request) {
}
}

func server(args ...string) {
func Server(args ...string) {
rand.Seed(time.Now().UnixNano()) // for slot allocation

set := flag.NewFlagSet(args[0], flag.ExitOnError)
Expand Down

0 comments on commit 0202767

Please sign in to comment.