domain

package
v0.0.0-...-4832971 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleAdmin   = "admin"
	RoleManager = "manager"
)

Variables

This section is empty.

Functions

func Init

func Init(cfg *Config)

Types

type Community

type Community struct {
	Name    string
	Project string
}

type Config

type Config struct {
	VerificationCodeExpiry       int64 `json:"verification_code_expiry"`
	MaxNumOfEmployeeManager      int   `json:"max_num_of_employee_manager"`
	MinNumOfSameEmailDomainParts int   `json:"min_num_of_same_email_domain_parts"`
}

func (*Config) SetDefault

func (cfg *Config) SetDefault()

type CorpSigning

type CorpSigning struct {
	Id             string
	PDF            string
	Date           int64
	Link           Link
	Admin          Manager
	Managers       []Manager
	Corporation    Corporation
	Representative Representative

	Version int
}

func (*CorpSigning) AddEmailDomain

func (cs *CorpSigning) AddEmailDomain(email dp.EmailAddr) error

func (*CorpSigning) AddManagers

func (cs *CorpSigning) AddManagers(managers []Manager) error

func (*CorpSigning) EmailDomains

func (cs *CorpSigning) EmailDomains() []string

func (*CorpSigning) GetRole

func (cs *CorpSigning) GetRole(a dp.Account) string

func (*CorpSigning) IsSameCorp

func (cs *CorpSigning) IsSameCorp(email dp.EmailAddr) bool

func (*CorpSigning) RemoveManagers

func (cs *CorpSigning) RemoveManagers(managers []dp.Account) error

type Corporation

type Corporation struct {
	Name               dp.CorpName
	EmailDomains       []string
	PrimaryEmailDomain string
}

type EmployeeSigning

type EmployeeSigning struct {
	IndividualSigning

	Enabled       bool
	CorpSigningId string
}

func (*EmployeeSigning) ChangeEnabled

func (es *EmployeeSigning) ChangeEnabled(b bool) bool

func (*EmployeeSigning) Remove

func (es *EmployeeSigning) Remove() error

type IndividualSigning

type IndividualSigning struct {
	Id    string
	Date  int64
	Link  Link
	Name  dp.Name
	Email dp.EmailAddr
}
type Link struct {
	Id       string
	CLAId    string
	Language dp.Language
}

type Manager

type Manager struct {
	Name    dp.Name
	Email   dp.EmailAddr
	Account dp.Account
}

func (*Manager) IsSame

func (m *Manager) IsSame(m1 *Manager) bool

type Representative

type Representative struct {
	Name  dp.Name
	Email dp.EmailAddr
	Title dp.Title
}

type SigningIndex

type SigningIndex struct {
	LinkId    string
	SigningId string
}

type User

type User struct {
	Email          dp.EmailAddr
	Account        dp.Account
	Password       string
	CorpSigningId  string
	PasswordChaged bool
}

func (*User) ChangePassword

func (u *User) ChangePassword(p string)

type VerificationCode

type VerificationCode struct {
	VerificationCodeKey

	Expiry int64
}

func NewVerificationCode

func NewVerificationCode(code string, Purpose dp.Purpose) VerificationCode

func (*VerificationCode) IsExpired

func (vc *VerificationCode) IsExpired() bool

type VerificationCodeKey

type VerificationCodeKey struct {
	Code    string
	Purpose dp.Purpose
}

Jump to

Keyboard shortcuts

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