Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidID = fmt.Errorf("invalid preference id") ErrNotFound = fmt.Errorf("preference not found") ErrInvalidFilter = fmt.Errorf("invalid preference filter set") ErrTraitNotFound = fmt.Errorf("preference trait not found, preferences can only be created with valid trait") )
View Source
var DefaultTraits = []Trait{ { ResourceType: schema.UserPrincipal, Name: "profile_picture", Title: "Profile picture", Description: "Profile picture of the user", Heading: "Profile", Input: TraitInputText, }, { ResourceType: schema.UserPrincipal, Name: "first_name", Title: "Full name", Description: "Full name of the user", Heading: "Profile", Input: TraitInputText, }, { ResourceType: schema.OrganizationNamespace, Name: "logo", Title: "Logo", Description: "Select a logo for your organization.", Heading: "General", Input: TraitInputText, }, { ResourceType: schema.OrganizationNamespace, Name: "social_login", Title: "Social Login", Description: "Allow login through Google/Github/Facebook/etc single sign-on functionality.", Heading: "Security", SubHeading: "Manage organization security and how it's members authenticate.", Input: TraitInputCheckbox, }, { ResourceType: schema.OrganizationNamespace, Name: "mail_otp", Title: "Email code", Description: "Allow password less login via code delivered over email.", Heading: "Security", SubHeading: "Manage organization security and how it's members authenticate.", Input: TraitInputCheckbox, }, { ResourceType: schema.OrganizationNamespace, Name: "mail_link", Title: "Email magic link", Description: "Allow password less login via a link delivered over email.", Heading: "Security", SubHeading: "Manage organization security and how it's members authenticate.", Input: TraitInputCheckbox, }, }
Functions ¶
This section is empty.
Types ¶
type Preference ¶
type Repository ¶
type Repository interface {
Set(ctx context.Context, preference Preference) (Preference, error)
Get(ctx context.Context, id uuid.UUID) (Preference, error)
List(ctx context.Context, filter Filter) ([]Preference, error)
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo Repository) *Service
func (*Service) Create ¶
func (s *Service) Create(ctx context.Context, preference Preference) (Preference, error)
type Trait ¶
type Trait struct {
ResourceType string `json:"resource_type"`
Name string `json:"name"`
Title string `json:"title"`
Description string `json:"description"`
LongDescription string `json:"long_description"`
Heading string `json:"heading"`
SubHeading string `json:"sub_heading"`
Breadcrumb string `json:"breadcrumb"`
Input TraitInput `json:"input"`
InputHints string `json:"input_hints"`
}
type TraitInput ¶
type TraitInput string
const ( TraitInputText TraitInput = "text" TraitInputTextarea TraitInput = "textarea" TraitInputSelect TraitInput = "select" TraitInputCombobox TraitInput = "combobox" TraitInputCheckbox TraitInput = "checkbox" TraitInputMultiselect TraitInput = "multiselect" TraitInputNumber TraitInput = "number" )
Click to show internal directories.
Click to hide internal directories.