gitdump

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 8 Imported by: 0

README

gitdump

workflow badge Go Reference

A tool for dumping hosted git repositories to local in batch.

Features

  • supported git hosting platforms
    • github
    • gitee
    • gitea
    • coding

中文使用说明

Usage

Command

./gitdump -conf config.yaml

Configuration

dir: repos
concurrency: 3
accounts:
  - vendor: github
    # username, github username
    username: USERNAME
    # password, github personal token
    password: PERSONAL_TOKEN
  - vendor: gitee
    # username, gitee username
    username: USERNAME
    # password, gitee personal token
    password: PERSONAL_TOKEN
  - vendor: gitea
    # url, url of gitea instance
    url: https://your.gitea.com
    # username, gitea username
    username: USERNAME
    # password, gitea personal token
    password: PERSONAL_TOKEN
  - vendor: coding
    # url, url of coding instance
    url: https://your.coding.net
    # username, personal token username, displayed in token page, NOT YOUR CODING USERNAME
    username: TOKEN_USERNAME
    # password, personal token
    password: TOKEN

Container Image

Check GitHub Packages for available container images

Check Dockerfile for details

By default, container image will execute gitdump every 6 hours

All you need to do is to mount /data for data persistence, and put a config.yaml at /data/config.yaml

Notification

Execution result will be delivered to environment variable $NOTIFY_URL, if given, by HTTP POST.

{"text": "MESSAGE..."}

Donation

View https://guoyk.xyz/donation

Credits

GUO YANKE, MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MirrorGit

func MirrorGit(ctx context.Context, opts MirrorGitOptions) (err error)

func SetHosting

func SetHosting(vendor string, hosting Hosting)

Types

type Hosting

type Hosting interface {
	List(ctx context.Context, opts HostingOptions) (out []HostingRepo, err error)
}

func GetHosting

func GetHosting(vendor string) Hosting

type HostingOptions

type HostingOptions struct {
	URL      string
	Username string
	Password string
}

func (HostingOptions) MustPassword

func (ho HostingOptions) MustPassword()

func (HostingOptions) MustURL

func (ho HostingOptions) MustURL()

func (HostingOptions) MustUsername

func (ho HostingOptions) MustUsername()

type HostingRepo

type HostingRepo struct {
	SubDir   string
	URL      string
	Username string
	Password string
}

type MirrorGitOptions

type MirrorGitOptions struct {
	Dir         string
	URL         string
	Username    string
	AskPassFile string
}

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

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