client

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// predefined constants
	KindComposer = "composer"
	KindNpm      = "npm"
)

Functions

This section is empty.

Types

type GitLabConnection

type GitLabConnection struct {
	// contains filtered or unexported fields
}

GitLabConnection represent connection to GitLab

func NewConnectionFromRequest

func NewConnectionFromRequest(r *http.Request) (*GitLabConnection, error)

NewConnectionFromRequest - create new GitLabConnection for a given request

func (*GitLabConnection) ClearCachedList

func (c *GitLabConnection) ClearCachedList()

ClearCachedList - force remove projectList cache key for current token

func (*GitLabConnection) EnqueueProjectCache

func (c *GitLabConnection) EnqueueProjectCache()

EnqueueProjectCache - trigger projectList load code for current token, but if cache is exists, do nothing. Function will run in background.

func (*GitLabConnection) GetArchive

func (c *GitLabConnection) GetArchive(kind, uuid, ref string) ([]byte, error)

GetArchive - get binary buffer (tar.gz) for whole project by ref

func (*GitLabConnection) GetCachedList

func (c *GitLabConnection) GetCachedList() ([]string, time.Time)

return www items values for list of cached projects

func (*GitLabConnection) GetRepo

func (c *GitLabConnection) GetRepo(kind, uuid string) (*GitLabRepo, error)

GetRepo - return package repository

func (*GitLabConnection) GetRepoList

func (c *GitLabConnection) GetRepoList(kind string) ([]*GitLabRepo, error)

GetRepoList - return list of package repositories

type GitLabRepo

type GitLabRepo struct {
	Project      *gitlab.Project
	UUID         string
	TagList      []Tag
	Metadata     *JsonMap
	MetadataLock *sync.RWMutex
}

Represent project/package repository

type JsonMap

type JsonMap map[string]interface{}

func (*JsonMap) GetInterface

func (m *JsonMap) GetInterface(key string, def interface{}) (interface{}, error)

GetInterface - helper method to extract any value from underlying map

func (*JsonMap) GetListInterface

func (m *JsonMap) GetListInterface(key string, def *[]interface{}) (*[]interface{}, error)

GetListInterface - helper method to extract array/slice from underlying map

func (*JsonMap) GetMapInterface

func (m *JsonMap) GetMapInterface(key string, def map[string]interface{}) (*map[string]interface{}, error)

GetMapInterface - helper method to extract map from underlying map

func (*JsonMap) GetString

func (m *JsonMap) GetString(key string) (string, error)

GetString - helper method to extract string value from underlying map

type Tag

type Tag struct {
	Name         string
	Reference    string
	Metadata     *JsonMap
	MetadataLock *sync.RWMutex
}

Represent project/package tag

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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