ostreeuploader

package
v0.0.0-...-1d89571 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOAuthToken

func GetOAuthToken(auth *OAuth2) (string, error)

func GetUUID

func GetUUID() (string, error)

func Tar

func Tar(repoDir string, files map[string]uint32) (*io.PipeReader, <-chan *SendReport)

Types

type CheckReport

type CheckReport struct {
	Checked   uint
	NotSynced uint
}

type CheckStatus

type CheckStatus struct {
	Check     <-chan uint
	NotSynced <-chan *RepoFile
}

type Checker

type Checker interface {
	OSTreeHubAccessor
	Check(corId string) error
	Wait() (*CheckReport, error)
}

func NewChecker

func NewChecker(repo string, credFile string, apiVer string) (Checker, error)

func NewCheckerNoAuth

func NewCheckerNoAuth(repo string, hubURL string, factory string, apiVer string) (Checker, error)

func NewCheckerWithToken

func NewCheckerWithToken(repo, hubURL, factory, token, apiVer string) (Checker, error)

type FioToken

type FioToken string

func (FioToken) SetAuthHeader

func (t FioToken) SetAuthHeader(req *http.Request)

type OAuth2

type OAuth2 struct {
	Server string `json:"server"`
	ID     string `json:"client_id"`
	Secret string `json:"client_secret"`
}

type OAuth2Token

type OAuth2Token string

func (OAuth2Token) SetAuthHeader

func (t OAuth2Token) SetAuthHeader(req *http.Request)

type OAuthToken

type OAuthToken struct {
	Token   string `json:"access_token"`
	Expires uint64 `json:"expires_in"`
}

type OSTreeHub

type OSTreeHub struct {
	URL     string
	Factory string
	Auth    *OAuth2
}

func ExtractUrlAndFactory

func ExtractUrlAndFactory(credZip string) (*OSTreeHub, error)

type OSTreeHubAccessor

type OSTreeHubAccessor interface {
	Url() string
	Factory() string
}

type OSTreeInfo

type OSTreeInfo struct {
	Auth   OAuth2 `json:"oauth2"`
	NoAuth bool   `json:"no_auth"`
	Server struct {
		URL string `json:"server"`
	} `json:"ostree"`
}

func ParseCredArchive

func ParseCredArchive(credZip string) (*OSTreeInfo, error)

type Puller

type Puller interface {
	OSTreeHubAccessor
	Pull(commitHash string, corId string) error
}

func NewPuller

func NewPuller(repo string, credFile string, apiVer string) (Puller, error)

func NewPullerNoAuth

func NewPullerNoAuth(repo string, hubURL string, factory string, apiVer string) (Puller, error)

func NewPullerWithToken

func NewPullerWithToken(repo, hubURL, factory, token, apiVer string) (Puller, error)

type Pusher

type Pusher interface {
	OSTreeHubAccessor
	Push(corId string) error
	Wait() (*Report, error)
	UpdateSummary() error
}

func NewPusher

func NewPusher(repo string, credFile string, apiVer string) (Pusher, error)

func NewPusherNoAuth

func NewPusherNoAuth(repo string, hubURL string, factory string, apiVer string) (Pusher, error)

func NewPusherWithToken

func NewPusherWithToken(repo, hubURL, factory, token, apiVer string) (Pusher, error)

type RepoFile

type RepoFile struct {
	Path  string
	CRC32 uint32
}

type Report

type Report struct {
	Checked uint
	Sent    SendReport
	Synced  SyncReport
}

type SendReport

type SendReport struct {
	FileNumb uint
	ObjNumb  uint
	Bytes    int64
}

type Status

type Status struct {
	Check <-chan uint
	Send  <-chan *SendReport
	Sync  <-chan *SyncReport
}

type SyncReport

type SyncReport struct {
	UploadedFileNumb     uint32 `json:"uploaded"`
	SyncedFileNumb       uint32 `json:"synced"`
	UploadSyncedFileNumb uint32 `json:"upload_synced"`
	SyncFailedNumb       uint32 `json:"sync_failed"`
}

type Token

type Token interface {
	SetAuthHeader(req *http.Request)
}

Jump to

Keyboard shortcuts

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