Documentation ¶
Index ¶
- func GetRequestSubdomain(r *http.Request) string
- func GetSubdomainFromHost(r *http.Request) string
- type Handler
- type Store
- func (s Store) AddOrganization(ctx domain.RequestContext, o org.Organization) (err error)
- func (s Store) CheckDomain(ctx domain.RequestContext, domain string) string
- func (s Store) DeleteOrganization(ctx domain.RequestContext, orgID string) (rows int64, err error)
- func (s Store) GetOrganization(ctx domain.RequestContext, id string) (org org.Organization, err error)
- func (s Store) GetOrganizationByDomain(subdomain string) (o org.Organization, err error)
- func (s Store) RemoveOrganization(ctx domain.RequestContext, orgID string) (err error)
- func (s Store) UpdateAuthConfig(ctx domain.RequestContext, org org.Organization) (err error)
- func (s Store) UpdateOrganization(ctx domain.RequestContext, org org.Organization) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRequestSubdomain ¶
GetRequestSubdomain extracts subdomain from referring URL.
func GetSubdomainFromHost ¶
GetSubdomainFromHost extracts the subdomain from the requesting URL.
Types ¶
type Handler ¶
Handler contains the runtime information such as logging and database.
type Store ¶ added in v1.71.0
type Store struct { store.Context store.OrganizationStorer }
Store provides data access to organization (tenant) information.
func (Store) AddOrganization ¶ added in v1.71.0
func (s Store) AddOrganization(ctx domain.RequestContext, o org.Organization) (err error)
AddOrganization inserts the passed organization record into the organization table.
func (Store) CheckDomain ¶ added in v1.71.0
func (s Store) CheckDomain(ctx domain.RequestContext, domain string) string
CheckDomain makes sure there is an organisation with the correct domain
func (Store) DeleteOrganization ¶ added in v1.71.0
DeleteOrganization deletes the orgID organization from the organization table.
func (Store) GetOrganization ¶ added in v1.71.0
func (s Store) GetOrganization(ctx domain.RequestContext, id string) (org org.Organization, err error)
GetOrganization returns the Organization reocrod from the organization database table with the given id.
func (Store) GetOrganizationByDomain ¶ added in v1.71.0
func (s Store) GetOrganizationByDomain(subdomain string) (o org.Organization, err error)
GetOrganizationByDomain returns the organization matching a given URL subdomain. No context is required because user might not be authenticated yet.
func (Store) RemoveOrganization ¶ added in v1.71.0
func (s Store) RemoveOrganization(ctx domain.RequestContext, orgID string) (err error)
RemoveOrganization sets the orgID organization to be inactive, thus executing a "soft delete" operation.
func (Store) UpdateAuthConfig ¶ added in v1.71.0
func (s Store) UpdateAuthConfig(ctx domain.RequestContext, org org.Organization) (err error)
UpdateAuthConfig updates the given organization record in the database with the auth config details.
func (Store) UpdateOrganization ¶ added in v1.71.0
func (s Store) UpdateOrganization(ctx domain.RequestContext, org org.Organization) (err error)
UpdateOrganization updates the given organization record in the database to the values supplied.