Help us shape the future of Go! Take the 2026 Go Developer Survey

giteahttpmigration

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package giteahttpmigration migrates selected Git repositories and their account/RBAC data through HTTP only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Method     string
	URL        string
	StatusCode int
	Body       string
}

func (*APIError) Error

func (e *APIError) Error() string

type Collaborator

type Collaborator struct {
	UserName   string `json:"username"`
	Permission string `json:"permission"`
}

type ConflictPolicy

type ConflictPolicy string
const (
	ConflictFail ConflictPolicy = "fail"
	ConflictSkip ConflictPolicy = "skip"
)

type Credential

type Credential struct {
	UserName           string `json:"username"`
	TemporaryPassword  string `json:"temporary_password"`
	MustChangePassword bool   `json:"must_change_password"`
}

type CredentialWriter

type CredentialWriter interface {
	WriteCredential(Credential) error
}

type GitObject

type GitObject struct {
	Type string `json:"type"`
	SHA  string `json:"sha"`
}

type JSONLCredentialFile

type JSONLCredentialFile struct {
	// contains filtered or unexported fields
}

func NewJSONLCredentialFile

func NewJSONLCredentialFile(filePath string) (*JSONLCredentialFile, error)

func (*JSONLCredentialFile) Close

func (f *JSONLCredentialFile) Close() error

func (*JSONLCredentialFile) WriteCredential

func (f *JSONLCredentialFile) WriteCredential(credential Credential) error

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

func New

func New(options Options) (*Migrator, error)

func (*Migrator) Apply

func (m *Migrator) Apply(ctx context.Context, plan *Plan, credentials CredentialWriter) (*Result, error)

func (*Migrator) Discover

func (m *Migrator) Discover(ctx context.Context) (*Plan, error)

type MirrorRequest

type MirrorRequest struct {
	SourceURL   string
	SourceLogin string
	SourceToken string
	TargetURL   string
	TargetLogin string
	TargetToken string
}

type Options

type Options struct {
	SourceURL      string
	SourceToken    string
	TargetURL      string
	TargetToken    string
	Repositories   []string
	ConflictPolicy ConflictPolicy
	HTTPClient     *http.Client
	Mirror         RepositoryMirror
}

type Organization

type Organization struct {
	Name                      string `json:"name"`
	FullName                  string `json:"full_name"`
	Email                     string `json:"email"`
	Description               string `json:"description"`
	Website                   string `json:"website"`
	Location                  string `json:"location"`
	Visibility                string `json:"visibility"`
	RepoAdminChangeTeamAccess bool   `json:"repo_admin_change_team_access"`
}

type OrganizationPlan

type OrganizationPlan struct {
	Organization  Organization `json:"organization"`
	Owner         string       `json:"owner"`
	PublicMembers []string     `json:"public_members,omitempty"`
	Teams         []TeamPlan   `json:"teams"`
}

type Plan

type Plan struct {
	SourceURL     string             `json:"source_url"`
	SourceLogin   string             `json:"source_login"`
	TargetURL     string             `json:"target_url"`
	Users         []User             `json:"users"`
	Organizations []OrganizationPlan `json:"organizations"`
	Repositories  []RepositoryPlan   `json:"repositories"`
	Warnings      []string           `json:"warnings,omitempty"`
}

type Reference

type Reference struct {
	Ref    string     `json:"ref"`
	Object *GitObject `json:"object"`
}

type Repository

type Repository struct {
	Owner         *User  `json:"owner"`
	Name          string `json:"name"`
	FullName      string `json:"full_name"`
	Description   string `json:"description"`
	Private       bool   `json:"private"`
	Internal      bool   `json:"internal"`
	Empty         bool   `json:"empty"`
	CloneURL      string `json:"clone_url"`
	DefaultBranch string `json:"default_branch"`
	Archived      bool   `json:"archived"`
}

type RepositoryMirror

type RepositoryMirror func(context.Context, MirrorRequest) error

type RepositoryPlan

type RepositoryPlan struct {
	Repository    Repository     `json:"repository"`
	Refs          []Reference    `json:"refs,omitempty"`
	Collaborators []Collaborator `json:"collaborators,omitempty"`
}

type RepositoryRef

type RepositoryRef struct {
	Owner string `json:"owner"`
	Name  string `json:"name"`
}

func (RepositoryRef) String

func (r RepositoryRef) String() string

type Result

type Result struct {
	UsersCreated         int `json:"users_created"`
	UsersSkipped         int `json:"users_skipped"`
	OrganizationsCreated int `json:"organizations_created"`
	OrganizationsSkipped int `json:"organizations_skipped"`
	TeamsCreated         int `json:"teams_created"`
	TeamsReused          int `json:"teams_reused"`
	RepositoriesCreated  int `json:"repositories_created"`
	RepositoriesSkipped  int `json:"repositories_skipped"`
	TeamMemberships      int `json:"team_memberships_applied"`
	TeamRepositories     int `json:"team_repositories_applied"`
	Collaborators        int `json:"collaborators_applied"`
	PublicMemberships    int `json:"public_memberships_applied"`
	RefsVerified         int `json:"refs_verified"`
}

type Team

type Team struct {
	ID                      int64             `json:"id"`
	Name                    string            `json:"name"`
	Description             string            `json:"description"`
	IncludesAllRepositories bool              `json:"includes_all_repositories"`
	Permission              string            `json:"permission"`
	Units                   []string          `json:"units,omitempty"`
	UnitsMap                map[string]string `json:"units_map,omitempty"`
	CanCreateOrgRepo        bool              `json:"can_create_org_repo"`
}

type TeamPlan

type TeamPlan struct {
	Team         Team            `json:"team"`
	Members      []string        `json:"members"`
	Repositories []RepositoryRef `json:"repositories"`
}

type User

type User struct {
	UserName      string    `json:"login"`
	FullName      string    `json:"full_name"`
	Email         string    `json:"email"`
	Visibility    string    `json:"visibility"`
	Restricted    bool      `json:"restricted"`
	IsAdmin       bool      `json:"is_admin"`
	IsActive      bool      `json:"active"`
	ProhibitLogin bool      `json:"prohibit_login"`
	Created       time.Time `json:"created"`
}

Jump to

Keyboard shortcuts

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