types

package
v0.0.0-...-ffb091d Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlreadyExists = fmt.Errorf("Already exists")
View Source
var HasItem = &hasItemChecker{}
View Source
var LimitError = fmt.Errorf("Plan limit exceeded")
View Source
var NotFound = fmt.Errorf("Not found")
View Source
var Unauthorized = fmt.Errorf("Unauthorized")

Functions

func RandomString

func RandomString(length int) string

func ValidateDAO

func ValidateDAO(dao func() DAO, c *C)

func Validate_AddPackageURI_Unique

func Validate_AddPackageURI_Unique(dao DAO, c *C)

func Validate_AddRelease_Big_Metadata

func Validate_AddRelease_Big_Metadata(dao DAO, c *C)

func Validate_AddRelease_Unique

func Validate_AddRelease_Unique(dao DAO, c *C)

func Validate_AddRelease_Unique_per_project

func Validate_AddRelease_Unique_per_project(dao DAO, c *C)

func Validate_ApplicationMetadata

func Validate_ApplicationMetadata(dao DAO, c *C)

func Validate_Dependencies

func Validate_Dependencies(dao DAO, c *C)

func Validate_FindAllVersions

func Validate_FindAllVersions(dao DAO, c *C)

func Validate_FindAllVersions_Empty

func Validate_FindAllVersions_Empty(dao DAO, c *C)

func Validate_GetAllReleases

func Validate_GetAllReleases(dao DAO, c *C)

func Validate_GetApplications

func Validate_GetApplications(dao DAO, c *C)

func Validate_GetDownstreamHooks

func Validate_GetDownstreamHooks(dao DAO, c *C)

func Validate_GetNamespaces

func Validate_GetNamespaces(dao DAO, c *C)

func Validate_GetNamespacesByNames

func Validate_GetNamespacesByNames(dao DAO, c *C)

func Validate_GetNamespacesFilteredBy

func Validate_GetNamespacesFilteredBy(dao DAO, c *C)

func Validate_GetNamespacesForUser

func Validate_GetNamespacesForUser(dao DAO, c *C)

func Validate_GetPackageURIs

func Validate_GetPackageURIs(dao DAO, c *C)

func Validate_GetRelease

func Validate_GetRelease(dao DAO, c *C)

func Validate_GetRelease_NotFound

func Validate_GetRelease_NotFound(dao DAO, c *C)

func Validate_GetReleasesWithoutProcessedDependencies

func Validate_GetReleasesWithoutProcessedDependencies(dao DAO, c *C)

func Validate_HardDeleteNamespace

func Validate_HardDeleteNamespace(dao DAO, c *C)

func Validate_Metrics

func Validate_Metrics(dao DAO, c *C)

func Validate_ProjectMetadata

func Validate_ProjectMetadata(dao DAO, c *C)

func Validate_Providers

func Validate_Providers(dao DAO, c *C)

func Validate_ProvidersFilteredBy

func Validate_ProvidersFilteredBy(dao DAO, c *C)

func Validate_PublicNamespace

func Validate_PublicNamespace(dao DAO, c *C)

func Validate_TagRelease

func Validate_TagRelease(dao DAO, c *C)

func Validate_WipeDatabase

func Validate_WipeDatabase(dao DAO, c *C)

Types

type Application

type Application struct {
	Name          string    `json:"name"`
	Project       string    `json:"project"`
	Description   string    `json:"description"`
	LatestVersion string    `json:"latest_version"`
	UploadedBy    string    `json:"uploaded_by"`
	UploadedAt    time.Time `json:"uploaded_at"`
	Hooks         Hooks     `json:"hooks"` // only used for view purposes
}

func NewApplication

func NewApplication(project, name string) *Application

type ApplicationsDAO

type ApplicationsDAO interface {
	GetApplication(namespace, name string) (*Application, error)
	AddApplication(app *Application) error
	UpdateApplication(app *Application) error
	GetApplications(namespace string) (map[string]*Application, error)
	FindAllVersions(application *Application) ([]string, error)
	GetApplicationHooks(*Application) (Hooks, error)
	SetApplicationHooks(*Application, Hooks) error
	GetDownstreamHooks(*Application) ([]*Hooks, error)
	SetApplicationSubscribesToUpdatesFrom(*Application, []*Application) error
}

type DAO

type DependenciesDAO

type DependenciesDAO interface {
	GetAllReleasesWithoutProcessedDependencies() ([]*Release, error)
	SetDependencies(*Release, []*Dependency) error
	GetDependencies(*Release) ([]*Dependency, error)
	GetDownstreamDependencies(*Release) ([]*Dependency, error)
	GetDownstreamDependenciesFilteredBy(*Release, *DownstreamDependenciesFilter) ([]*Dependency, error)
	SetDependencyTree(*Release, []*DependencyTree) error
	GetDependencyTree(*Release) ([]*DependencyTree, error)
}

type Dependency

type Dependency struct {
	Project     string `json:"project"`
	Application string `json:"name"`
	Version     string `json:"version"`
	BuildScope  bool   `json:"build"`
	DeployScope bool   `json:"deploy"`
	IsExtension bool   `json:"is_extension"`
}

func NewDependency

func NewDependency(project, name, version string) *Dependency

type DependencyTree

type DependencyTree struct {
	Dependency *Dependency       `json:"dependency"`
	Children   []*DependencyTree `json:"children"`
}

func NewDependencyTree

func NewDependencyTree(d *Dependency) *DependencyTree

type DownstreamDependenciesFilter

type DownstreamDependenciesFilter struct {
	Namespaces []string
}

func NewDownstreamDependenciesFilter

func NewDownstreamDependenciesFilter(namespaces []string) *DownstreamDependenciesFilter

type Hooks

type Hooks map[string]map[string]string

func NewHooks

func NewHooks() Hooks

type Metrics

type Metrics struct {
	ProjectCount int
}

func NewMetrics

func NewMetrics(projectCount int) *Metrics

type MetricsDAO

type MetricsDAO interface {
	GetUserMetrics(username string) (*Metrics, error)
	SetUserMetrics(username string, previous, new *Metrics) error
}

type MinimalReleaseMetadata

type MinimalReleaseMetadata struct {
	Application string `json:"application"`
	Project     string `json:"project"`
	Version     string `json:"version"`
	Description string `json:"description"`
}

Used for view purposes

func (*MinimalReleaseMetadata) GetReleaseId

func (m *MinimalReleaseMetadata) GetReleaseId() string

type NamespacesDAO

type NamespacesDAO interface {
	GetNamespace(namespace string) (*Project, error)
	AddNamespace(*Project) error
	HardDeleteNamespace(namespace string) error
	UpdateNamespace(*Project) error
	GetNamespaces() (map[string]*Project, error)
	GetNamespacesByNames(namespaces []string) (map[string]*Project, error)
	GetNamespacesForUser(namespaces []string) (map[string]*Project, error)
	GetNamespacesFilteredBy(*NamespacesFilter) (map[string]*Project, error)
	GetNamespaceHooks(*Project) (Hooks, error)
	SetNamespaceHooks(*Project, Hooks) error
}

type NamespacesFilter

type NamespacesFilter struct {
	Namespaces []string
}

func NewNamespacesFilter

func NewNamespacesFilter(namespaces []string) *NamespacesFilter

type Project

type Project struct {
	Name           string   `json:"name"`
	Description    string   `json:"description"`
	OrgURL         string   `json:"org_url"`
	Hooks          Hooks    `json:"hooks,omitempty"` // only used for view purposes
	Permission     string   `json:"permission"`      // only used for view purposes
	MatchingGroups []string `json:"-"`               // used to work out highest permission in model
	IsPublic       bool     `json:"is_public"`
}

func NewProject

func NewProject(project string) *Project

type ProvidersFilter

type ProvidersFilter struct {
	Namespaces []string
}

func NewProvidersFilter

func NewProvidersFilter(namespaces []string) *ProvidersFilter

type Release

type Release struct {
	Application           *Application
	ReleaseId             string
	Version               string
	Metadata              *core.ReleaseMetadata
	ProcessedDependencies bool
	Downloads             int
	UploadedBy            string
	UploadedAt            time.Time
}

func NewRelease

func NewRelease(app *Application, metadata *core.ReleaseMetadata) *Release

type ReleasesDAO

type ReleasesDAO interface {
	GetRelease(namespace, name, releaseId string) (*Release, error)
	GetReleaseByTag(namespace, name, tag string) (*Release, error)
	TagRelease(release *Release, tag string) error
	AddRelease(*Release) error
	UpdateRelease(*Release) error
	GetAllReleases() ([]*Release, error)
	GetPackageURIs(release *Release) ([]string, error)
	AddPackageURI(release *Release, uri string) error
	GetProviders(providerName string) (map[string]*MinimalReleaseMetadata, error)
	GetProvidersFilteredBy(providerName string, q *ProvidersFilter) (map[string]*MinimalReleaseMetadata, error)
	RegisterProviders(release *core.ReleaseMetadata) error
}

Jump to

Keyboard shortcuts

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