cli

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

server 1、接收客户端文件上传: upload接口 2、支持客户端文件下载: listfile downloadfile

Index

Constants

This section is empty.

Variables

View Source
var (
	// flag
	ClientCmd = &cobra.Command{
		Use:          "client",
		Short:        "start tusd client",
		Long:         "start tusd client, and upload a file",
		Example:      "...",
		SilenceUsage: false,
	}

	ClientDownloadCmd = &cobra.Command{
		Use:   "download",
		Short: "download",
		RunE: func(cmd *cobra.Command, args []string) error {
			err := client.DownloadStart()
			if err != nil {
				logger.DefaultLogger.Error(err.Error())
			}
			return err
		},
	}

	ClientUploadCmd = &cobra.Command{
		Use:   "upload",
		Short: "upload",
		RunE: func(cmd *cobra.Command, args []string) error {
			err := client.UploadStart()
			if err != nil {
				logger.DefaultLogger.Error(err.Error())
			}
			return err
		},
	}
)
View Source
var (
	// flag
	ServerCmd = &cobra.Command{
		Use:          "server",
		Short:        "start tusd server",
		Example:      "...",
		SilenceUsage: false,
		RunE: func(cmd *cobra.Command, args []string) error {
			ctx, cancel := context.WithCancel(context.TODO())
			defer cancel()
			err := server.Start(ctx)
			if err != nil {
				logger.DefaultLogger.Error(err.Error())
			}
			return err
		},
	}
)

Functions

func Execute

func Execute()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL