cmd

package
v0.0.0-...-91649ba Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright 2020 duyanghao

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(flags *Flags)

Types

type ClientCfg

type ClientCfg struct {
	RootDirectory     string   `yaml:"rootDirectory,omitempty"`
	Trackers          []string `yaml:"trackers,omitempty"`
	Seeders           []string `yaml:"seeders,omitempty"`
	LimitSize         string   `yaml:"limitSize,omitempty"`
	DownloadRateLimit string   `yaml:"downloadRateLimit,omitempty"`
	UploadRateLimit   string   `yaml:"uploadRateLimit,omitempty"`
	DownloadTimeout   int      `yaml:"downloadTimeout,omitempty"`
	Port              int      `yaml:"port,omitempty"`
}

type Config

type Config struct {
	ClientCfg *ClientCfg `yaml:"clientCfg,omitempty"`
	ProxyCfg  *ProxyCfg  `yaml:"proxyCfg,omitempty"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig parses configuration file and returns an initialized Settings object and an error object if any. For instance if it cannot find the configuration file it will set the returned error appropriately.

type Flags

type Flags struct {
	ConfigFile string
}

Flags defines seeder CLI flags.

func ParseFlags

func ParseFlags() *Flags

ParseFlags parses origin CLI flags.

type ProxyCfg

type ProxyCfg struct {
	Port     int      `yaml:"port,omitempty"`
	Verbose  bool     `yaml:"verbose,omitempty"`
	Rules    []string `yaml:"rules,omitempty"`
	CertFile string   `yaml:"certFile,omitempty"`
	KeyFile  string   `yaml:"keyFile,omitempty"`
}

Jump to

Keyboard shortcuts

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