syncpki

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2019 License: BSD-3-Clause Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddInMap

func AddInMap(item string, m map[string]SubMap)

func DecodeRRDPBase64

func DecodeRRDPBase64(value string) ([]byte, error)

func FetchFile

func FetchFile(path string, conv bool) ([]byte, error)

func FilterMatch

func FilterMatch(line string) (string, bool, error)

Determines if file has been deleted

func GetDownloadPath

func GetDownloadPath(sync string, trimFile bool) (string, error)

func GetMatch

func GetMatch(str string) bool

Check if string is a file

func ParseMapDirectory

func ParseMapDirectory(mapdir string) map[string]string

func ParseNode

func ParseNode(data string) ([]Cert, []Cert, error)

func ReduceMap

func ReduceMap(m map[string]SubMap) []string

func ReplacePath

func ReplacePath(file *pki.PKIFile, replace map[string]string) string

func ReplaceString

func ReplaceString(pathRep string, replace map[string]string) string

Types

type Cert

type Cert struct {
	URI   string `xml:"uri,attr"`
	Value string `xml:",chardata"`
}

type Delta

type Delta struct {
	RootNode
	XMLName  xml.Name `xml:"delta"`
	Publish  []Cert   `xml:"publish"`
	Withdraw []Cert   `xml:"withdraw"`
}

type ElNode

type ElNode struct {
	Serial int64  `xml:"serial,attr"`
	URI    string `xml:"uri,attr"`
	Hash   string `xml:"hash,attr"`
}

type FileStat

type FileStat struct {
	Path    string
	Deleted bool
}

type HTTPFetcher

type HTTPFetcher struct {
	UserAgent string
	Client    *http.Client
}

func (*HTTPFetcher) GetXML

func (f *HTTPFetcher) GetXML(url string) (string, error)

type LocalFetch

type LocalFetch struct {
	MapDirectory  map[string]string
	Log           Logger
	PathAvailable []string
}

func (*LocalFetch) GetFile

func (s *LocalFetch) GetFile(file *pki.PKIFile) (*pki.SeekFile, error)

func (*LocalFetch) GetFileConv

func (s *LocalFetch) GetFileConv(file *pki.PKIFile, convert bool) (*pki.SeekFile, error)

func (*LocalFetch) GetRepository

func (s *LocalFetch) GetRepository(file *pki.PKIFile, callback pki.CallbackExplore) error

type Logger

type Logger interface {
	Infof(string, ...interface{})
	Info(...interface{})
	Debugf(string, ...interface{})
	Debug(...interface{})
	Errorf(string, ...interface{})
	Error(...interface{})
}

type Notification

type Notification struct {
	RootNode
	XMLName  xml.Name `xml:"notification"`
	Snapshot ElNode   `xml:"snapshot"`
	Deltas   []ElNode `xml:"delta"`
}

func ParseRoot

func ParseRoot(data string) (Notification, error)

type RRDPFetcher

type RRDPFetcher interface {
	GetXML(string) (string, error)
}

type RRDPFile

type RRDPFile func(main string, url string, path string, data []byte, withdraw bool, snapshot bool, curId int64, args ...interface{}) error

type RRDPSystem

type RRDPSystem struct {
	Log     Logger
	Fetcher RRDPFetcher

	Callback RRDPFile

	Path      string
	SessionID string
	Serial    int64
}

func (*RRDPSystem) FetchRRDP

func (s *RRDPSystem) FetchRRDP(cbArgs ...interface{}) error

type RootNode

type RootNode struct {
	Xmlns     string `xml:"xmlns,attr"`
	Version   string `xml:"version,attr"`
	SessionID string `xml:"session_id,attr"`
	Serial    int64  `xml:"serial,attr"`
}

type RsyncSystem

type RsyncSystem struct {
	Log Logger
}

func (*RsyncSystem) RunRsync

func (s *RsyncSystem) RunRsync(ctx context.Context, uri string, bin string, dirPath string) ([]*FileStat, error)

Runs the rsync binary on a URL

type Snapshot

type Snapshot struct {
	RootNode
	XMLName  xml.Name `xml:"snapshot"`
	Publish  []Cert   `xml:"publish"`
	Withdraw []Cert   `xml:"withdraw"`
}

type SubMap

type SubMap struct {
	Subitem map[string]SubMap
	Count   int
}

Jump to

Keyboard shortcuts

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