domain

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2019 License: AGPL-3.0 Imports: 13 Imported by: 113

Documentation

Overview

Package domain defines data structures for moving data between services.

Index

Constants

View Source
const (
	// CommunityEdition is AGPL licensed open core of product.
	CommunityEdition Edition = "Community"

	// EnterpriseEdition is proprietary closed-source product.
	EnterpriseEdition Edition = "Enterprise"

	// PackageEssentials provides core capabilities.
	PackageEssentials Package = "Essentials"

	// PackageAdvanced provides analytics, reporting,
	// content lifecycle, content verisoning, and audit logs.
	PackageAdvanced Package = "Advanced"

	// PackagePremium provides actions, feedback capture,
	// approvals workflow, secure external sharing.
	PackagePremium Package = "Premium"

	// PackageDataCenter provides multi-tenanting
	// and a bunch of professional services.
	PackageDataCenter Package = "Data Center"

	// PlanCloud represents *.documize.com hosting.
	PlanCloud Plan = "Cloud"

	// PlanSelfHost represents privately hosted Documize instance.
	PlanSelfHost Plan = "Self-host"

	// Seats0 is 0 users.
	Seats0 Seats = 0

	// Seats1 is 10 users.
	Seats1 Seats = 10

	// Seats2 is 25 users.
	Seats2 Seats = 25

	//Seats3 is 50 users.
	Seats3 Seats = 50

	// Seats4 is 100 users.
	Seats4 Seats = 100

	//Seats5 is 250 users.
	Seats5 Seats = 250

	// Seats6 is unlimited.
	Seats6 Seats = 9999
)
View Source
const DocumizeContextKey key = "documize context key"

DocumizeContextKey prevents key name collisions.

Variables

This section is empty.

Functions

func SubscriptionAsXML added in v1.73.0

func SubscriptionAsXML(j SubscriptionData) (b []byte, err error)

SubscriptionAsXML returns subscription data as XML document:

<DocumizeLicense>

<Key>some key</Key>
<Signature>some signature</Signature>

</DocumizeLicense>

XML document is empty in case of error.

Types

type Edition added in v1.73.0

type Edition string

Edition is either Community or Enterprise.

type Package added in v1.73.0

type Package string

Package controls feature-set within edition.

type Plan added in v1.73.0

type Plan string

Plan tells us if instance if self-hosted or Documize SaaS/Cloud.

type Product added in v1.73.0

type Product struct {
	Edition  Edition
	Title    string
	Version  string
	Major    string
	Minor    string
	Patch    string
	Revision int

	// UserCount is number of users within Documize instance by tenant.
	UserCount map[string]int
}

Product provides product meta information and handles subscription validation for Enterprise edition.

func (*Product) IsValid added in v1.73.0

func (p *Product) IsValid(ctx RequestContext) bool

IsValid returns if subscription is valid using RequestContext.

type RequestContext

type RequestContext struct {
	AllowAnonymousAccess bool
	Authenticated        bool
	Guest                bool
	UserID               string
	OrgID                string
	OrgName              string
	SSL                  bool
	AppURL               string // e.g. https://{url}.documize.com
	Subdomain            string
	ClientIP             string
	Expires              time.Time
	Fullname             string
	Transaction          *sqlx.Tx
	Administrator        bool
	Analytics            bool
	Active               bool
	Editor               bool
	GlobalAdmin          bool
	ViewUsers            bool
	Subscription         Subscription
}

RequestContext provides per request scoped values required for HTTP handlers.

func GetRequestContext

func GetRequestContext(r *http.Request) (ctx RequestContext)

GetRequestContext returns RequestContext from context.Context

func (*RequestContext) GetAppURL

func (c *RequestContext) GetAppURL(endpoint string) string

GetAppURL returns full HTTP url for the app

type Seats added in v1.73.0

type Seats int

Seats represents number of users.

type Subscription added in v1.73.0

type Subscription struct {
	ID      string    `json:"id"`
	Name    string    `json:"name"`
	Email   string    `json:"email"`
	Edition Edition   `json:"edition"`
	Plan    Plan      `json:"plan"`
	Start   time.Time `json:"start"`
	End     time.Time `json:"end"`
	Seats   Seats     `json:"seats"`
	Trial   bool      `json:"trial"`
	Price   uint64    `json:"price"`
	// Derived fields
	ActiveUsers int `json:"activeUsers"`
	Status      int `json:"status"`
}

Subscription data for customer.

func DecodeSubscription added in v1.73.0

func DecodeSubscription(sd SubscriptionData) (sub Subscription, err error)

DecodeSubscription returns Documize issued product licensing information.

func (*Subscription) IsEmpty added in v1.73.0

func (s *Subscription) IsEmpty() bool

IsEmpty determines if we have a license.

type SubscriptionData added in v1.73.0

type SubscriptionData struct {
	Key       string `json:"key"`
	Signature string `json:"signature"`
}

SubscriptionData holds encrypted data and is unpacked into Subscription.

type SubscriptionUserAccount added in v1.73.0

type SubscriptionUserAccount struct {
	OrgID string `json:"orgId"`
	Users int    `json:"users"`
}

SubscriptionUserAccount states number of active users by tenant.

type SubscriptionXML added in v1.73.0

type SubscriptionXML struct {
	XMLName   xml.Name `xml:"Documize"`
	Key       string
	Signature string
}

SubscriptionXML represents subscription data as XML document.

Directories

Path Synopsis
Package audit records user events.
Package audit records user events.
Package backup handle data backup/restore to/from ZIP format.
Package backup handle data backup/restore to/from ZIP format.
Package category handles API calls and persistence for categories.
Package category handles API calls and persistence for categories.
store
Package store provides the implementation for a file system based storage provider.
Package store provides the implementation for a file system based storage provider.
Package permission handles API calls and persistence for spaces.
Package permission handles API calls and persistence for spaces.
Package setting manages both global and user level settings Package setting manages both global and user level settings Package setting manages both global and user level settings
Package setting manages both global and user level settings Package setting manages both global and user level settings Package setting manages both global and user level settings
Package smtp provides access to SMTP server for sending email.
Package smtp provides access to SMTP server for sending email.
Package space handles API calls and persistence for spaces.
Package space handles API calls and persistence for spaces.

Jump to

Keyboard shortcuts

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