depman

package module
v0.0.0-...-de866ac Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2016 License: GPL-3.0 Imports: 15 Imported by: 0

README

depman

Build Status

Minimalist approach to C/C++ library and header storage

Building

git clone https://github.com/moensch/depman
cd depman && ./build static

Running

docker-compose up -d

Adding file

Documentation

Index

Constants

View Source
const RequestNS = 0

Variables

View Source
var (
	StoreDir  string
	DefaultNS string
)
View Source
var ErrNotFound = errors.New("Entry not found")

Functions

func GetLatestVersion

func GetLatestVersion(filter map[string]interface{}, table string) (string, error)

func HandleDownloadExtraFile

func HandleDownloadExtraFile(w http.ResponseWriter, r *http.Request)

func HandleFileDownload

func HandleFileDownload(w http.ResponseWriter, r *http.Request)

func HandleFileUpload

func HandleFileUpload(w http.ResponseWriter, r *http.Request)

func HandleGetExtraFile

func HandleGetExtraFile(w http.ResponseWriter, r *http.Request)
func HandleGetFileLinks(w http.ResponseWriter, r *http.Request)

func HandleGetLibrary

func HandleGetLibrary(w http.ResponseWriter, r *http.Request)

func HandleGetLibraryVersion

func HandleGetLibraryVersion(w http.ResponseWriter, r *http.Request)

func HandleIndex

func HandleIndex(w http.ResponseWriter, r *http.Request)

func HandleListFiles

func HandleListFiles(w http.ResponseWriter, r *http.Request)

func HandleListLibraries

func HandleListLibraries(w http.ResponseWriter, r *http.Request)

func HandleListLibraryVersions

func HandleListLibraryVersions(w http.ResponseWriter, r *http.Request)

func HandlePutFile

func HandlePutFile(w http.ResponseWriter, r *http.Request)
func HandlePutLink(w http.ResponseWriter, r *http.Request)

func HandleUploadExtraFile

func HandleUploadExtraFile(w http.ResponseWriter, r *http.Request)

func NewRouter

func NewRouter() *mux.Router

func SendErrorResponse

func SendErrorResponse(w http.ResponseWriter, r *http.Request, err_resp error)

func SendJSONResponse

func SendJSONResponse(w http.ResponseWriter, code int, resp string)

func SendResponse

func SendResponse(w http.ResponseWriter, r *http.Request, resp JsonAble)

func SendTEXTResponse

func SendTEXTResponse(w http.ResponseWriter, code int, resp string)

Types

type DepMan

type DepMan struct {
	Router *mux.Router
}

func NewServer

func NewServer() (*DepMan, error)

func (*DepMan) Run

func (c *DepMan) Run(listenAddr string)

type ExtraFile

type ExtraFile struct {
	Id        int       `json:"extrafile_id"`
	Version   string    `json:"version"`
	NameSpace string    `json:"ns"`
	Name      string    `json:"name"`
	Info      string    `json:"info"`
	Created   time.Time `json:"created"`
}

func GetExtraFileByFilter

func GetExtraFileByFilter(filter map[string]interface{}) (ExtraFile, error)

func NewExtraFileFromVars

func NewExtraFileFromVars(vars map[string]string) ExtraFile

func (*ExtraFile) FilePath

func (f *ExtraFile) FilePath() string

func (*ExtraFile) Store

func (f *ExtraFile) Store() error

func (ExtraFile) ToJsonString

func (f ExtraFile) ToJsonString() (string, error)

func (ExtraFile) ToString

func (f ExtraFile) ToString() string

type ExtraFiles

type ExtraFiles []ExtraFile

func (ExtraFiles) ToJsonString

func (f ExtraFiles) ToJsonString() (string, error)

func (ExtraFiles) ToString

func (f ExtraFiles) ToString() string

type File

type File struct {
	Id               int       `json:"file_id"`
	LibraryVersionId int       `json:"library_version_id"`
	Library          string    `json:"library"`
	Version          string    `json:"version"`
	NameSpace        string    `json:"ns"`
	Name             string    `json:"name"`
	Type             string    `json:"type"`
	Platform         string    `json:"platform"`
	Arch             string    `json:"arch"`
	Info             string    `json:"info"`
	Created          time.Time `json:"created"`
	Links            FileLinks `json:"file_links"`
}

func NewFileFromVars

func NewFileFromVars(vars map[string]string) File

func (*File) FilePath

func (f *File) FilePath() string
func (f *File) GetLinks() (FileLinks, error)

func (*File) Store

func (f *File) Store() error

func (File) ToJsonString

func (f File) ToJsonString() (string, error)

func (File) ToString

func (f File) ToString() string
type FileLink struct {
	Id      int       `json:"file_link_id"`
	FileId  int       `json:"file_id"`
	Name    string    `json:"name"`
	Created time.Time `json:"created"`
}

func (*FileLink) Store

func (fl *FileLink) Store() error
type FileLinks []FileLink

func GetFileLinksByFileId

func GetFileLinksByFileId(file_id int) (FileLinks, error)

func (FileLinks) ToJsonString

func (f FileLinks) ToJsonString() (string, error)

func (FileLinks) ToString

func (f FileLinks) ToString() string

type Files

type Files []File

func GetFilesByFilter

func GetFilesByFilter(filter map[string]interface{}, find_version bool) (Files, error)

func (Files) ToJsonString

func (f Files) ToJsonString() (string, error)

func (Files) ToString

func (f Files) ToString() string

type JsonAble

type JsonAble interface {
	ToJsonString() (string, error)
	ToString() string
}

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

type Routes

type Routes []Route

func RouteDefinitions

func RouteDefinitions() Routes

type SimpleEntries

type SimpleEntries []SimpleEntry

func ListLibraries

func ListLibraries() (SimpleEntries, error)

func ListVersions

func ListVersions(library string) (SimpleEntries, error)

func (SimpleEntries) ToJsonString

func (l SimpleEntries) ToJsonString() (string, error)

func (SimpleEntries) ToString

func (l SimpleEntries) ToString() string

type SimpleEntry

type SimpleEntry struct {
	Name string `json:"name"`
}

func GetLibrary

func GetLibrary(library string) (SimpleEntry, error)

func GetVersion

func GetVersion(library string, version string) (SimpleEntry, error)

func (SimpleEntry) ToJsonString

func (l SimpleEntry) ToJsonString() (string, error)

func (SimpleEntry) ToString

func (l SimpleEntry) ToString() string

Directories

Path Synopsis
cmd
depman-cli command
depman-srv command

Jump to

Keyboard shortcuts

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