community: github.com/documize/community/domain/organization Index | Files

package organization

import "github.com/documize/community/domain/organization"

Index

Package Files

endpoint.go organization.go store.go

func GetRequestSubdomain Uses

func GetRequestSubdomain(r *http.Request) string

GetRequestSubdomain extracts subdomain from referring URL.

func GetSubdomainFromHost Uses

func GetSubdomainFromHost(r *http.Request) string

GetSubdomainFromHost extracts the subdomain from the requesting URL.

type Handler Uses

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

Handler contains the runtime information such as logging and database.

func (*Handler) Get Uses

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

Get returns the requested organization.

func (*Handler) Update Uses

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 Uses

type Store struct {
    store.Context
    store.OrganizationStorer
}

Store provides data access to organization (tenant) information.

func (Store) AddOrganization Uses

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 Uses

func (s Store) CheckDomain(ctx domain.RequestContext, domain string) string

CheckDomain makes sure there is an organisation with the correct domain

func (Store) DeleteOrganization Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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.

Package organization imports 18 packages (graph) and is imported by 9 packages. Updated 2019-05-31. Refresh now. Tools for package owners.