svn

package module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: BSD-3-Clause Imports: 10 Imported by: 0

README

image:https://travis-ci.com/jhinrichsen/svn.svg?branch=master["Build Status", link="https://travis-ci.com/jhinrichsen/svn"]
image:https://img.shields.io/github/release/jhinrichsen/svn.svg["Release", link="https://github.com/jhinrichsen/svn/releases/latest"]
image:https://godoc.org/github.com/jhinrichsen/svn?status.svg["godoc", link="https://godoc.org/github.com/jhinrichsen/svn"]
image:https://goreportcard.com/badge/github.com/jhinrichsen/svn["Go report card", link="https://goreportcard.com/report/github.com/jhinrichsen/svn"]
image:https://golangci.com/badges/github.com/jhinrichsen/svn.svg["Golang CI", link="https://golangci.com/r/github.com/jhinrichsen/svn"]

= svn

Wrapper for Apache Subversion. Uses svn's `xml` output instead of native C bindings.
Calls external `svn` command, so you need a working Subversion client executable for your platform.
Avoids CGO, and the hassle around `libsvn1`, `libapr1`, `libaprutil1`, `libc6`, `libsasl2`, `db5.3-util` e.a.

Supports

- `svn list` (useful to implement watchers using `Since()`)
- `svn export`

= Installation

== Prerequisites

=== Build

- Go (golang.org)

=== Runtime

- A working `svn` client

=== Build from source

----
$ go get github.com/jhinrichsen/svn
----

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit added in v0.3.0

type Commit struct {
	Revision string    `xml:"revision,attr"`
	Author   string    `xml:"author"`
	Date     time.Time `xml:"date"`
}

Commit represents XML output of an `svn list` subcommand

type Entry added in v0.3.0

type Entry struct {
	Kind   string `xml:"kind,attr"`
	Name   string `xml:"name"`
	Commit Commit `xml:"commit"`
}

ListEntry represents XML output of an `svn list` subcommand

func Since added in v0.4.0

func Since(entries []Entry, t time.Time) []Entry

Since returns all entries created after t

type ListElement added in v0.3.0

type ListElement struct {
	XMLName xml.Name `xml:"lists"`
	Entries []Entry  `xml:"list>entry"`
}

List represents XML output of an `svn list` subcommand

type Repository added in v0.3.0

type Repository struct {
	Location string
}

Repository holds information about a (possibly remote) repository

func NewRepository added in v0.3.0

func NewRepository(l string) *Repository

NewRepository will initialize the internal structure of a possible remote repository, usually pointing to the parent of the default trunk/ tags/ branches structure.

func (*Repository) Export added in v0.5.0

func (a *Repository) Export(relpath string, into string, w io.Writer, notifier chan string) error

Export will execute an `svn export` subcommand. combined output of stdout and stderr will be written to w absolute filenames will be written to notifier channel for each exported file

func (*Repository) FullPath added in v0.3.0

func (a *Repository) FullPath(relpath string) string

FullPath returns the full path into a repository

func (*Repository) List added in v0.3.0

func (a *Repository) List(relpath string, w io.Writer) ([]Entry, error)

List will execute an `svn list` subcommand. Any non-nil xmlWriter will receive the XML content

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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