lfs

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2015 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "0.5.0"

Variables

View Source
var (
	LargeSizeThreshold = 5 * 1024 * 1024
	TempDir            = filepath.Join(os.TempDir(), "git-lfs")
	UserAgent          string
	LocalWorkingDir    string
	LocalGitDir        string
	LocalMediaDir      string
	LocalLogDir        string
)
View Source
var (
	Config = NewConfig()
)
View Source
var (
	NotInARepositoryError = errors.New("Not in a repository")
)

Functions

func CopyWithCallback

func CopyWithCallback(writer io.Writer, reader io.Reader, totalSize int64, cb CopyCallback) (int64, error)

func DoHTTP

func DoHTTP(c *Configuration, req *http.Request) (*http.Response, error)

func Environ

func Environ() []string

func InRepo

func InRepo() bool

func InstallFilters

func InstallFilters() error

func InstallHooks

func InstallHooks(force bool) error

func LocalMediaPath

func LocalMediaPath(sha string) (string, error)

func ObjectUrl

func ObjectUrl(endpoint Endpoint, oid string) (*url.URL, error)

func ResetTempDir

func ResetTempDir() error

func Stack

func Stack() []byte

func TempFile

func TempFile(prefix string) (*os.File, error)

Types

type AltConfig

type AltConfig struct {
	Remote map[string]*struct {
		Media string
	}

	Media struct {
		Url string
	}
}

type CallbackReader

type CallbackReader struct {
	C         CopyCallback
	TotalSize int64
	ReadSize  int64
	io.Reader
}

func (*CallbackReader) Read

func (w *CallbackReader) Read(p []byte) (int, error)

type ClientError

type ClientError struct {
	Message          string `json:"message"`
	DocumentationUrl string `json:"documentation_url,omitempty"`
	RequestId        string `json:"request_id,omitempty"`
}

func (*ClientError) Error

func (e *ClientError) Error() string

type Configuration

type Configuration struct {
	CurrentRemote string
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Configuration

func (*Configuration) Endpoint

func (c *Configuration) Endpoint() Endpoint

func (*Configuration) GitConfig

func (c *Configuration) GitConfig(key string) (string, bool)

func (*Configuration) HttpClient

func (c *Configuration) HttpClient() *http.Client

func (*Configuration) ObjectUrl

func (c *Configuration) ObjectUrl(oid string) (*url.URL, error)

func (*Configuration) RemoteEndpoint

func (c *Configuration) RemoteEndpoint(remote string) Endpoint

func (*Configuration) Remotes

func (c *Configuration) Remotes() []string

func (*Configuration) SetConfig

func (c *Configuration) SetConfig(key, value string)

type CopyCallback

type CopyCallback func(int64, int64) error

func CopyCallbackFile

func CopyCallbackFile(event, filename string, index, totalFiles int) (CopyCallback, *os.File, error)

type CredentialCmd

type CredentialCmd struct {
	SubCommand string
	*exec.Cmd
	// contains filtered or unexported fields
}

func NewCommand

func NewCommand(input Creds, subCommand string) *CredentialCmd

func (*CredentialCmd) Credentials

func (c *CredentialCmd) Credentials() Creds

func (*CredentialCmd) StdoutString

func (c *CredentialCmd) StdoutString() string

type Creds

type Creds map[string]string

func (Creds) Buffer

func (c Creds) Buffer() *bytes.Buffer

type Endpoint

type Endpoint struct {
	Url            string
	SshUserAndHost string
	SshPath        string
}

type HookExists

type HookExists struct {
	Name string
	Path string
}

func (*HookExists) Error

func (e *HookExists) Error() string

type WrappedError

type WrappedError struct {
	Err     error
	Message string
	Panic   bool
	// contains filtered or unexported fields
}

func Download

func Download(oid string) (io.ReadCloser, int64, *WrappedError)

func Error

func Error(err error) *WrappedError

func Errorf

func Errorf(err error, format string, args ...interface{}) *WrappedError

func Upload

func Upload(oidPath, filename string, cb CopyCallback) *WrappedError

func (*WrappedError) Context

func (e *WrappedError) Context() map[string]string

func (*WrappedError) Del

func (e *WrappedError) Del(key string)

func (*WrappedError) Error

func (e *WrappedError) Error() string

func (*WrappedError) Errorf

func (e *WrappedError) Errorf(format string, args ...interface{})

func (*WrappedError) Get

func (e *WrappedError) Get(key string) string

func (*WrappedError) InnerError

func (e *WrappedError) InnerError() string

func (*WrappedError) Set

func (e *WrappedError) Set(key, value string)

func (*WrappedError) Stack

func (e *WrappedError) Stack() []byte

Jump to

Keyboard shortcuts

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