Documentation ¶
Index ¶
- Constants
- Variables
- type Asset
- type DataMap
- type ModelFunctionsCommon
- type Privilege
- type Privileges
- type Product
- type ProductData
- type ProductUser
- type ProductUserIDs
- type Project
- type ProjectData
- type ProjectUserIDs
- type ProjectViewer
- type RepoFunctions
- func (f *RepoFunctions) ClearAsset(asset *Asset, typeString string) error
- func (f *RepoFunctions) GetField(asset *Asset, typeString string, defaultValue string) interface{}
- func (f *RepoFunctions) GetFilePath(asset *Asset, typeString string, defaultPath string) string
- func (f *RepoFunctions) NewAsset(references DataMap) (*Asset, error)
- func (f *RepoFunctions) NewProduct(name string, detailsID *uuid.UUID, assetsID *uuid.UUID) (*Product, error)
- func (f *RepoFunctions) NewProject(productID *uuid.UUID, detailsID *uuid.UUID, assetsID *uuid.UUID) (*Project, error)
- func (f *RepoFunctions) NewUser(name string, email string, password []byte, settingsID uuid.UUID, ...) (*User, error)
- func (f *RepoFunctions) SetField(asset *Asset, typeString string, field interface{})
- func (f *RepoFunctions) SetFilePath(asset *Asset, typeString string, extension string) error
- type RepoUUID
- type UUIDCommon
- type UUIDImplMock
- type User
- type UserData
- type UserProduct
- type UserProductIDs
- type UserProject
- type UserProjectIDs
- type ViewUsers
- type Viewer
- type ViewersList
Constants ¶
const ( Public = "Public" // Public is visible for everyone including nont registered visitors Protected = "Protected" // Content is available for registered users Private = "Private" // Content is available for the owner and users the product or project is shared with. )
This contants describe the visibility of proucts and projects
const ( SupportClients = "support_clients" ClientUI = "client_ui" ProjectUI = "project_ui" Requires3D = "requires_3d" HasTrial = "has_trial" IsFree = "is_free" )
const (
BaseAssetPath = "base_asset_path"
)
const (
TwoStepsVerif = "two_steps_verif"
)
Variables ¶
var ErrAssetRefNotInitialised = errors.New("Asset references not initialised")
var ErrInvalidAssetsID = "Invalid assets uuid"
var ErrInvalidSettingsID = "Invalid settings uuid"
var ErrProductDetailsNotInitialised = "Details map not initialised"
var ErrSettingNotInitialised = "Settings not initialised"
Functions ¶
This section is empty.
Types ¶
type DataMap ¶ added in v0.0.7
type DataMap map[string]interface{}
Assets structure contains the identification of all user related documents images.
type ModelFunctionsCommon ¶ added in v0.0.10
type ModelFunctionsCommon interface { NewAsset(references DataMap) (*Asset, error) NewUser( name string, email string, password []byte, settingsID uuid.UUID, assetsID uuid.UUID) (*User, error) NewProduct(name string, detailsID *uuid.UUID, assetsID *uuid.UUID) (*Product, error) NewProject(productID *uuid.UUID, detailsID *uuid.UUID, assetsID *uuid.UUID) (*Project, error) GetFilePath(asset *Asset, typeString string, defaultPath string) string SetFilePath(asset *Asset, typeString string, extension string) error GetField(asset *Asset, typeString string, defaultURL string) interface{} SetField(asset *Asset, typeString string, field interface{}) ClearAsset(asset *Asset, typeString string) error }
type Privileges ¶
type Privileges []*Privilege
func (Privileges) IsOwnerPrivilege ¶ added in v0.0.7
func (l Privileges) IsOwnerPrivilege(privilege int) bool
func (Privileges) IsPartnerPrivilege ¶ added in v0.0.7
func (l Privileges) IsPartnerPrivilege(privilege int) bool
func (Privileges) IsValidPrivilege ¶
func (l Privileges) IsValidPrivilege(privilege int) bool
type ProductData ¶ added in v0.0.9
type ProductUser ¶ added in v0.0.9
type ProductUserIDs ¶ added in v0.0.9
type ProjectData ¶ added in v0.0.9
type ProjectUserIDs ¶ added in v0.0.9
type ProjectViewer ¶ added in v0.0.21
type RepoFunctions ¶ added in v0.0.10
type RepoFunctions struct {
UUIDImpl UUIDCommon
}
var ModelFunctions *RepoFunctions
func (*RepoFunctions) ClearAsset ¶ added in v0.0.10
func (f *RepoFunctions) ClearAsset(asset *Asset, typeString string) error
func (*RepoFunctions) GetField ¶ added in v0.0.10
func (f *RepoFunctions) GetField(asset *Asset, typeString string, defaultValue string) interface{}
func (*RepoFunctions) GetFilePath ¶ added in v0.0.10
func (f *RepoFunctions) GetFilePath(asset *Asset, typeString string, defaultPath string) string
func (*RepoFunctions) NewAsset ¶ added in v0.0.10
func (f *RepoFunctions) NewAsset(references DataMap) (*Asset, error)
func (*RepoFunctions) NewProduct ¶ added in v0.0.10
func (f *RepoFunctions) NewProduct(name string, detailsID *uuid.UUID, assetsID *uuid.UUID) (*Product, error)
NewProduct creates a new product instance where details describe the configuration of the product and references contain all asset references.
func (*RepoFunctions) NewProject ¶ added in v0.0.10
func (*RepoFunctions) SetField ¶ added in v0.0.10
func (f *RepoFunctions) SetField(asset *Asset, typeString string, field interface{})
func (*RepoFunctions) SetFilePath ¶ added in v0.0.10
func (f *RepoFunctions) SetFilePath(asset *Asset, typeString string, extension string) error
type UUIDCommon ¶ added in v0.0.10
type UUIDImplMock ¶ added in v0.0.7
type UUIDImplMock struct {
// contains filtered or unexported fields
}
UUIDImplMock overwrites the default github uuid library implementation.
var UUIDImpl *UUIDImplMock
type User ¶
type User struct { ID uuid.UUID Name string Email string Password []byte SettingsID uuid.UUID AssetsID uuid.UUID }
User defines the user structures. Each user must have an associated settings entry.
type UserData ¶ added in v0.0.9
type UserData struct { ID uuid.UUID `json:"id" validate:"required"` Name string `json:"username" validate:"required"` Email string `json:"email" validate:"required"` Password []byte `json:"password" validate:"required"` Settings *Asset `json:"settings" validate:"required"` Assets *Asset `json:"assets" validate:"required"` }
type UserProduct ¶ added in v0.0.9
type UserProduct struct { ProductData ProductData Privilege int }
type UserProductIDs ¶ added in v0.0.9
type UserProject ¶ added in v0.0.9
type UserProject struct { ProjectData *ProjectData Privilege int }
type UserProjectIDs ¶ added in v0.0.9
type ViewersList ¶ added in v0.0.9
type ViewersList []Viewer
Viewers describes a set of project data. Each set has a single viewer ID. Whichever user possese this ID can view the data with this ID. The set of project data has a single owner user. This structure contains the owner and the list of users who can view the data.