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
- Variables
- 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 ¶
var UUIDMap = map[string]string{
"INT/multielectrode_grasp": "f83565d148510fede8a277f660e1a419",
"ajkumaraswamy/HB-PAC_disinhibitory_network": "1090f803258557299d287c4d44a541b2",
"steffi/Kleineidam_et_al_2017": "f53069de4c4921a3cfa8f17d55ef98bb",
"Churan/Morris_et_al_Frontiers_2016": "97bc1456d3f4bca2d945357b3ec92029",
"fabee/efish_locking": "6953bbf0087ba444b2d549b759de4a06",
}
UUIDMap is a map between registered repositories and their UUIDs for datasets registered before the new UUID generation method was implemented. This map is required because the current method of computing UUIDs differs from the older method and this lookup is used to handle the old-method UUIDs.
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
FileName string
FileSize string
Title string
Authors []Author
Description string
Keywords []string
References []Reference
Funding []string
License *License
ResourceType string
DateTime time.Time
TemplateVersion string
}
DOIRegInfo holds all the metadata and information necessary for a DOI registration request.
func (*DOIRegInfo) GetCitation ¶
func (c *DOIRegInfo) GetCitation() string
func (*DOIRegInfo) GetType ¶
func (c *DOIRegInfo) GetType() string
func (*DOIRegInfo) ISODate ¶ added in v0.3.2
func (c *DOIRegInfo) ISODate() string
func (*DOIRegInfo) Year ¶ added in v0.3.2
func (c *DOIRegInfo) Year() 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
}