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
- func Decrypt(key, ciphertext []byte) ([]byte, error)
- func DecryptString(key []byte, encstring string) (string, error)
- func DecryptURLString(key []byte, encstring string) (string, error)
- func Encrypt(key, plaintext []byte) ([]byte, error)
- func EncryptString(key []byte, plaintext string) (string, error)
- func EncryptURLString(key []byte, plaintext string) (string, error)
- func IsRegisteredDOI(doi string) bool
- func MakeZip(dest io.Writer, source ...string) error
- func ReadConf(key string) string
- func ReadConfDefault(key, defval string) string
- func RepoPathToUUID(URI string) string
- type Author
- type BlobSResult
- type CommitSResult
- type DOIRegInfo
- type DOIRequestData
- type IndexBlob
- type IndexCommit
- type IndexRequest
- type License
- type NamedIdentifier
- type Reference
- type SearchRequest
- type SearchResults
Constants ¶
const ( SEARCH_MATCH = iota SEARCH_FUZZY SEARCH_WILDCARD SEARCH_QUERY SEARCH_SUGGEST )
Variables ¶
This section is empty.
Functions ¶
func DecryptString ¶
DecryptString decrypts an AES encrypted base64 string.
func DecryptURLString ¶
DecryptURLString decrypts an AES encrypted URL encoded base64 string.
func EncryptString ¶
EncryptString encrypts a string using AES and returns it in base64.
func EncryptURLString ¶
EncryptURLString encrypts a string using AES and returns it in URL encoded base64.
func IsRegisteredDOI ¶
func MakeZip ¶
MakeZip recursively writes all the files found under the provided sources to the dest io.Writer in ZIP format. Any directories listed in source are archived recursively. Empty directories are ignored.
func ReadConf ¶
ReadConf returns the value of a configuration env variable. If the variable is not set, an empty string is returned (ignores any errors).
func ReadConfDefault ¶
ReadConfDefault returns the value of a configuration env variable. If the variable is not set, the default is returned.
func RepoPathToUUID ¶
RepoPathToUUID computes a UUID from a repository path.
Types ¶
type Author ¶
func (*Author) GetValidID ¶
func (c *Author) GetValidID() *NamedIdentifier
func (*Author) RenderAuthor ¶
type BlobSResult ¶
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
ResourceType 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 DOIRequestData ¶
DOIRequestData is used to transmit data from GIN to DOI when a registration request is triggered.
type IndexCommit ¶
type IndexRequest ¶
type NamedIdentifier ¶
type SearchRequest ¶
type SearchResults ¶
type SearchResults struct {
Blobs []BlobSResult
Commits []CommitSResult
}