Documentation ¶
Index ¶
- Constants
- Variables
- type Action
- type Change
- type Changelog
- type ChangelogRecord
- type ChangelogRecords
- type ChangelogService
- type Changes
- type Domain
- type DomainOptions
- type DomainService
- type DomainUsers
- type Domains
- type DomainsPage
- type Error
- type Package
- type PackageOptions
- type PackageResolution
- type PackageService
- type Packages
- type PackagesPage
- type Service
- type VCS
Constants ¶
View Source
const ( RefTypeBranch = "branch" RefTypeTag = "tag" )
Variables ¶
View Source
var ( Forbidden = NewError(403, "forbidden") DomainNotFound = NewError(1000, "domain not found") DomainAlreadyExists = NewError(1001, "domain already exists") DomainFQDNRequired = NewError(1010, "domain fqdn required") DomainOwnerUserIDRequired = NewError(1020, "domain owner user id required") UserDoesNotExist = NewError(1100, "user does not exist") UserExists = NewError(1101, "user exists") PackageNotFound = NewError(2000, "package not found") PackageAlreadyExists = NewError(2001, "package already exists") PackageDomainRequired = NewError(2010, "package domain required") PackagePathRequired = NewError(2011, "package path required") PackageVCSRequired = NewError(2012, "package vcs required") PackageRepoRootRequired = NewError(2013, "package repo rut required") ChangelogRecordNotFound = NewError(3000, "changelog record not found") )
Errors that are related to the Packages Service.
View Source
var ( // ErrorRegistry is a map of error codes to errors. // It is usually used in gopherpit.com/gopherpit/pkg/client.Client. ErrorRegistry = apiClient.NewMapErrorRegistry(nil) )
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action string
var ( ActionAddDomain Action = "add-domain" ActionUpdateDomain Action = "update-domain" ActionDeleteDomain Action = "delete-domain" ActionDomainAddUser Action = "domain-add-user" ActionDomainRemoveUser Action = "domain-remove-user" ActionAddPackage Action = "add-package" ActionUpdatePackage Action = "update-package" ActionDeletePackage Action = "delete-package" )
type Change ¶
type Change struct { Field string `json:"field"` From *string `json:"from,omitempty"` To *string `json:"to,omitempty"` }
func (Change) FromString ¶
type Changelog ¶
type Changelog struct { Records ChangelogRecords `json:"records"` Previous string `json:"previous,omitempty"` Next string `json:"next,omitempty"` Count int `json:"count,omitempty"` }
type ChangelogRecord ¶
type ChangelogRecord struct { ID string `json:"id,omitempty"` Time time.Time `json:"time,omitempty"` DomainID string `json:"domain-id,omitempty"` FQDN string `json:"fqdn,omitempty"` PackageID string `json:"package-id,omitempty"` Path string `json:"path,omitempty"` UserID string `json:"user-id,omitempty"` Action Action `json:"action,omitempty"` Changes Changes `json:"changes,omitempty"` }
func (ChangelogRecord) ImportPrefix ¶
func (c ChangelogRecord) ImportPrefix() string
type ChangelogRecords ¶
type ChangelogRecords []ChangelogRecord
type ChangelogService ¶
type ChangelogService interface { ChangelogRecord(domainRef, id string) (*ChangelogRecord, error) DeleteChangelogRecord(domainRef, id string) (*ChangelogRecord, error) ChangelogForDomain(domainRef, start string, limit int) (Changelog, error) }
type Domain ¶
type Domain struct { ID string `json:"id"` FQDN string `json:"fqdn"` OwnerUserID string `json:"owner-user-id,omitempty"` CertificateIgnore bool `json:"certificate-ignore,omitempty"` Disabled bool `json:"disabled,omitempty"` // Internal functionality fields (changes not logged) CertificateIgnoreMissing bool `json:"certificate-ignore-missing,omitempty"` }
type DomainOptions ¶
type DomainOptions struct { FQDN *string `json:"fqdn,omitempty"` OwnerUserID *string `json:"owner-user-id,omitempty"` CertificateIgnore *bool `json:"certificate-ignore,omitempty"` Disabled *bool `json:"disabled,omitempty"` CertificateIgnoreMissing *bool `json:"certificate-ignore-missing,omitempty"` }
type DomainService ¶
type DomainService interface { Domain(ref string) (*Domain, error) AddDomain(o *DomainOptions, byUserID string) (*Domain, error) UpdateDomain(ref string, o *DomainOptions, byUserID string) (*Domain, error) DeleteDomain(ref, byUserID string) (*Domain, error) DomainUsers(ref string) (DomainUsers, error) AddUserToDomain(ref, userID, byUserID string) error RemoveUserFromDomain(ref, userID, byUserID string) error Domains(startFQDN string, limit int) (DomainsPage, error) DomainsByUser(userID, startRef string, limit int) (DomainsPage, error) DomainsByOwner(userID, startRef string, limit int) (DomainsPage, error) }
type DomainUsers ¶
type DomainsPage ¶
type Error ¶
type Error struct { // Message is a text that describes an error. Message string `json:"message"` // Code is a number that identifies error. // It allows error identification when serialization is involved. Code int `json:"code"` }
Error is a structure that holds error message and code.
type Package ¶
type Package struct { ID string `json:"id"` Domain *Domain `json:"domain,omitempty"` Path string `json:"path"` VCS VCS `json:"vcs"` RepoRoot string `json:"repo-root"` RefType string `json:"ref-type"` RefName string `json:"ref-name"` GoSource string `json:"go-source,omitempty"` RedirectURL string `json:"redirect-url,omitempty"` Disabled bool `json:"disabled,omitempty"` }
Package hods data that represents Go package location and metadate for remotr import path. https://golang.org/cmd/go/#hdr-Remote_import_paths
func (Package) ImportPrefix ¶
type PackageOptions ¶
type PackageOptions struct { Domain *string `json:"domain,omitempty"` Path *string `json:"path,omitempty"` VCS *VCS `json:"vcs,omitempty"` RepoRoot *string `json:"repo-root,omitempty"` RefType *string `json:"ref-type"` RefName *string `json:"ref-name"` GoSource *string `json:"go-source,omitempty"` RedirectURL *string `json:"redirect-url,omitempty"` Disabled *bool `json:"disabled,omitempty"` }
type PackageResolution ¶
type PackageResolution struct { ImportPrefix string `json:"import-prefix"` VCS VCS `json:"vcs"` RepoRoot string `json:"repo-root"` RefType string `json:"ref-type"` RefName string `json:"ref-name"` GoSource string `json:"go-source,omitempty"` RedirectURL string `json:"redirect-url,omitempty"` Disabled bool `json:"disabled,omitempty"` }
type PackageService ¶
type PackageService interface { Package(id string) (*Package, error) AddPackage(o *PackageOptions, byUserID string) (*Package, error) UpdatePackage(id string, o *PackageOptions, byUserID string) (*Package, error) DeletePackage(id string, byUserID string) (*Package, error) PackagesByDomain(domainRef, startName string, limit int) (PackagesPage, error) ResolvePackage(path string) (*PackageResolution, error) }
type PackagesPage ¶
type Service ¶
type Service interface { DomainService PackageService ChangelogService }
Click to show internal directories.
Click to hide internal directories.