libgin

package
v0.0.0-...-2219a9b Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package libgin provides functionality shared between the G-Node GIN services. These include: - GIN Web: The G-Node/GOGS fork (https://github.com/G-Node/gogs) - GIN DOI: The DOI registration service (https://github.com/G-Node/gin-doi) - GIN DEX: The indexing service for GIN (https://github.com/G-Node/gin-dex)

Index

Constants

View Source
const (
	SEARCH_MATCH = iota
	SEARCH_FUZZY
	SEARCH_WILDCARD
	SEARCH_QUERRY
	SEARCH_SUGGEST
)

Variables

This section is empty.

Functions

func IsRegisteredDOI

func IsRegisteredDOI(doi string) bool

func MakeZip

func MakeZip(dest io.Writer, source ...string) error

MakeZip creates a zip archive using the dest io.Writer from the files specified by source. Any directories listed in source are archived recursively. Empty directories are ignored.

func ReadConf

func ReadConf(key string) string

ReadConf returns the value of a configuration env variable and exits with an error if it is not set.

func ReadConfDefault

func ReadConfDefault(key, defval string) string

ReadConfDefault returns the value of a configuration env variable. If the variable is not set, the default is returned.

func RepoPathToUUID

func RepoPathToUUID(URI string) string

RepoPathToUUID computes a UUID from a repository path.

Types

type Author

type Author struct {
	FirstName   string
	LastName    string
	Affiliation string
	ID          string
}

func (*Author) GetValidID

func (c *Author) GetValidID() *NamedIdentifier

func (*Author) RenderAuthor

func (a *Author) RenderAuthor() string

type BlobSResult

type BlobSResult struct {
	Source    *IndexBlob  `json:"_source"`
	Score     float64     `json:"_score"`
	Highlight interface{} `json:"highlight"`
}

type CommitSResult

type CommitSResult struct {
	Source    *IndexCommit `json:"_source"`
	Score     float64      `json:"_score"`
	Highlight interface{}  `json:"highlight"`
}

type DOIRegInfo

type DOIRegInfo struct {
	Missing     []string
	DOI         string
	UUID        string
	FileSize    int64
	Title       string
	Authors     []Author
	Description string
	Keywords    []string
	References  []Reference
	Funding     []string
	License     *License
	DType       string
}

DOIRegInfo holds all the metadata and information necessary for a DOI registration request.

func (*DOIRegInfo) EscXML

func (c *DOIRegInfo) EscXML(txt string) string

func (*DOIRegInfo) GetCitation

func (c *DOIRegInfo) GetCitation() string

func (*DOIRegInfo) GetType

func (c *DOIRegInfo) GetType() string

type IndexBlob

type IndexBlob struct {
	*gig.Blob
	GinRepoName  string
	GinRepoId    string
	FirstCommit  string
	Id           int64
	Oid          gig.SHA1
	IndexingTime time.Time
	Content      string
	Path         string
}

type IndexCommit

type IndexCommit struct {
	*gig.Commit
	GinRepoId    string
	Oid          gig.SHA1
	GinRepoName  string
	IndexingTime time.Time
}

type License

type License struct {
	Name string
	URL  string
}

type NamedIdentifier

type NamedIdentifier struct {
	URI    string
	Scheme string
	ID     string
}

type Reference

type Reference struct {
	Reftype string
	Name    string
	DOI     string
}

type SearchRequest

type SearchRequest struct {
	Token  string
	CsrfT  string
	UserID int64
	Querry string
	SType  int64
}

type SearchResults

type SearchResults struct {
	Blobs   []BlobSResult
	Commits []CommitSResult
}

Jump to

Keyboard shortcuts

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