gorjun

package
v0.0.0-...-4137cad Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GorjunFile

type GorjunFile struct {
	ID           string            `json:"id"`
	Hash         hashsums          `json:"hash"`
	Size         int               `json:"size"`
	Date         time.Time         `json:"upload-date-formatted"`
	Timestamp    string            `json:"upload-date-timestamp,omitempty"`
	Name         string            `json:"name,omitempty"`
	Tags         []string          `json:"tags,omitempty"`
	Owner        []string          `json:"owner,omitempty"`
	Parent       string            `json:"parent,omitempty"`
	Version      string            `json:"version,omitempty"`
	Filename     string            `json:"filename,omitempty"`
	Prefsize     string            `json:"prefsize,omitempty"`
	Signature    map[string]string `json:"signature,omitempty"`
	Description  string            `json:"description,omitempty"`
	Architecture string            `json:"architecture,omitempty"`
}

GorjunFile is a file located on Gorjun bucket server

type GorjunUser

type GorjunUser struct {
	Username     string // Username of gorjun user
	Email        string // Email used to identify user in GPG
	Hostname     string // Hostname of the Gorjun server
	GPGDirectory string // GPGDirectory points to a gnupg directory in the file system
	Token        string // Active token
	TokenCode    string // Clean token code
	Passphrase   string // Passphrase used to decrypt private key
}

GorjunUser is a representation for Gorjun bucket

func FirstGorjunUser

func FirstGorjunUser() GorjunUser

func SecondGorjunUser

func SecondGorjunUser() GorjunUser

func VerifiedGorjunUser

func VerifiedGorjunUser() GorjunUser

func (*GorjunUser) AuthenticateUser

func (g *GorjunUser) AuthenticateUser() error

AuthenticateUser will try to authenticate user by downloading his token code, signing it with GPG and sending it back to server to get user token If passphrase is not empty, PGP will try to decrypt the private key before signing the code if gpgdir is empty, the default ($HOME/.gnupg) will be used

func (*GorjunUser) Delete

func (g *GorjunUser) Delete(artifacttype, parameters string) error

Delete files

func (*GorjunUser) DownloadFile

func (g *GorjunUser) DownloadFile(filename, outputDirectory string) error

DownloadFile will download file with specified name into the specified output directory

func (*GorjunUser) DownloadFileByID

func (g *GorjunUser) DownloadFileByID(ID, outputDirectory string) error

DownloadFileByID will download file with specified ID into the specified output directory

func (*GorjunUser) GetActiveToken

func (g *GorjunUser) GetActiveToken(signed string) error

GetActiveToken will send signed message to server and return active token that will be used for authneticated requests

func (*GorjunUser) GetAuthTokenCode

func (g *GorjunUser) GetAuthTokenCode() error

GetAuthTokenCode is a first step of authentication - it requests a special code from the server. This code needs to be PGP-signed later

func (*GorjunUser) GetFileByName

func (g *GorjunUser) GetFileByName(filename string, artifactType string) ([]GorjunFile, error)

GetFileByName will return information about a file with specified name

func (*GorjunUser) GetKeyByEmail

func (g *GorjunUser) GetKeyByEmail(keyring openpgp.EntityList, email string) *openpgp.Entity

func (*GorjunUser) List

func (g *GorjunUser) List(artifactType string, parameters string) ([]GorjunFile, error)

List returns a list of files

func (*GorjunUser) ListUserFiles

func (g *GorjunUser) ListUserFiles() ([]GorjunFile, error)

ListUserFiles returns a list of files that belongs to user

func (*GorjunUser) Register

func (g *GorjunUser) Register(username string)

func (*GorjunUser) RegisterUser

func (g *GorjunUser) RegisterUser(username string, publicKey string) (string, error)

func (*GorjunUser) RemoveFile

func (g *GorjunUser) RemoveFile(filename string, artifactType string) error

RemoveFile will delete file from gorjun with specified name. If multiple files with the same name exists belong to the same user only the last one (most recent) will be removed

func (*GorjunUser) RemoveFileByID

func (g *GorjunUser) RemoveFileByID(id string, artifactType string) error

RemoveFileByID will remove file with specified ID

func (*GorjunUser) Share

func (g *GorjunUser) Share(lists []GorjunFile, shareWith, artifactType string) error

Share files

func (*GorjunUser) SignToken

func (g *GorjunUser) SignToken(token string) (string, error)

SignToken will sign with GnuPG provided token and return signed version

func (*GorjunUser) Upload

func (g *GorjunUser) Upload(filename string, artifactType string, private string) (string, error)

UploadFile will upload file and return it's ID after successful upload

type Keys

type Keys struct {
}

Jump to

Keyboard shortcuts

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