organization

package
v3.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: AGPL-3.0 Imports: 18 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRequestSubdomain

func GetRequestSubdomain(r *http.Request) string

GetRequestSubdomain extracts subdomain from referring URL.

func GetSubdomainFromHost

func GetSubdomainFromHost(r *http.Request) string

GetSubdomainFromHost extracts the subdomain from the requesting URL.

Types

type Handler

type Handler struct {
	Runtime *env.Runtime
	Store   *store.Store
}

Handler contains the runtime information such as logging and database.

func (*Handler) Get

func (h *Handler) Get(w http.ResponseWriter, r *http.Request)

Get returns the requested organization.

func (*Handler) Update

func (h *Handler) Update(w http.ResponseWriter, r *http.Request)

Update saves organization amends.

func (h *Handler) UploadLogo(w http.ResponseWriter, r *http.Request)

UploadLogo stores log for organization.

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

func (s Store) DeleteOrganization(ctx domain.RequestContext, orgID string) (rows int64, err error)

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 record 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 (s Store) Logo(ctx domain.RequestContext, domain string) (l []byte, err error)

Logo fetchs stored image from store or NULL.

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.

func (s Store) UploadLogo(ctx domain.RequestContext, logo []byte) (err error)

UploadLogo saves custom logo to the organization record.

Jump to

Keyboard shortcuts

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