File: receive.go

package info (click to toggle)
golang-github-tonistiigi-fsutil 0.0~git20200331.f427cf1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 400 kB
  • sloc: makefile: 7
file content (24 lines) | stat: -rw-r--r-- 395 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package main

import (
	"context"
	"flag"
	"os"

	"github.com/tonistiigi/fsutil"
	"github.com/tonistiigi/fsutil/util"
)

func main() {
	flag.Parse()
	if len(flag.Args()) == 0 {
		panic("dest path not set")
	}

	ctx := context.Background()
	s := util.NewProtoStream(ctx, os.Stdin, os.Stdout)

	if err := fsutil.Receive(ctx, s, flag.Args()[0], fsutil.ReceiveOpt{}); err != nil {
		panic(err)
	}
}