Skip to content
Snippets Groups Projects
Select Git revision
  • 6565f6e4528b8b6ee0f9bffee8a61498f0ef9036
  • master default protected
  • feature/PRXS-3421-ImplementNewRefAPI
  • refactor/PRXS-3053-Files
  • feature/3149-LocaleCodeAsID-Feature
  • feature/PRXS-3383-CollectionsSort
  • feature/PRXS-3143-3235-ReferenceOptions
  • feature/PRXS-3143-LimitReferenceFields
  • feature/PRXS-3234-FeaturePruneIdents
  • PRXS-3421-RecursiveReferences
  • feature/3109-SerializeFeature
  • release/0.33
  • feature/3109-RecoverySchema
  • feature/3109-feature
  • fix/PRXS-3369-ValidateFields
  • refactor/PRXS-3306-MovePkgGroup1
  • refactor/6-pkg-refactor-expr
  • fix/PRXS-3360-TemplateBuilderPatch
  • feature/3293-MongoV2
  • feature/3272-GoVersionUp
  • feature/PRXS-3218-HideTemplateActions
  • v0.33.1
  • v0.32.0
  • v0.31.1
  • v0.31.0
  • v0.30.0
  • v0.29.0
  • v0.28.0
  • v0.27.0-alpha.1+16
  • v0.27.0-alpha.1+15
  • v0.27.0-alpha.1+14
  • v0.27.0-alpha.1+13
  • v0.27.0-alpha.1+12
  • v0.27.0-alpha.1+11
  • v0.27.0-alpha.1+10
  • v0.27.0-alpha.1+9
  • v0.27.0-alpha.1+8
  • v0.27.0-alpha.1+7
  • v0.27.0-alpha.1+6
  • v0.27.0-alpha.1+5
  • v0.27.0-alpha.1+4
41 results

ObjectIdentifier.go

Blame
  • content.go 1.21 KiB
    package content
    
    import (
    	"git.perx.ru/perxis/perxis-go/pkg/auth"
    	"git.perx.ru/perxis/perxis-go/pkg/clients"
    	"git.perx.ru/perxis/perxis-go/pkg/collaborators"
    	"git.perx.ru/perxis/perxis-go/pkg/collections"
    	"git.perx.ru/perxis/perxis-go/pkg/environments"
    	"git.perx.ru/perxis/perxis-go/pkg/invitations"
    	"git.perx.ru/perxis/perxis-go/pkg/items"
    	"git.perx.ru/perxis/perxis-go/pkg/locales"
    	"git.perx.ru/perxis/perxis-go/pkg/references"
    	"git.perx.ru/perxis/perxis-go/pkg/roles"
    	"git.perx.ru/perxis/perxis-go/pkg/spaces"
    	"git.perx.ru/perxis/perxis-go/pkg/version"
    )
    
    type Runnable interface {
    	Start()
    	Stop()
    }
    
    type Content struct {
    	collaborators.Collaborators
    	collections.Collections
    	environments.Environments
    	invitations.Invitations
    	items.Items
    	references.References
    	locales.Locales
    	roles.Roles
    	spaces.Spaces
    	clients.Clients
    	version.Versions
    
    	PrincipalFactory *auth.PrincipalFactory
    
    	runners []Runnable
    }
    
    const (
    	DBVersion uint32 = 2
    )
    
    func (c *Content) RegisterStart(svc interface{}) {
    	if r, ok := svc.(Runnable); ok {
    		c.runners = append(c.runners, r)
    	}
    }
    
    func (c Content) Start() {
    	for _, r := range c.runners {
    		r.Start()
    	}
    }
    
    func (c Content) Stop() {
    	for _, r := range c.runners {
    		r.Stop()
    	}
    }