organizations

package
v0.0.0-...-f1c2737 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteOrganization

func DeleteOrganization(ctx context.Context, organizationID uint64, db *sqlx.DB) error

Types

type Organization

type Organization struct {
	Id       uint64 `json:"id" db:"id"`
	Name     string `json:"name" db:"name"`
	Slug     string `json:"slug" db:"slug"`
	Authcode string `json:"authcode" db:"authcode"`

	// Contact info
	ContactUserId uint64      `json:"contact_user_id" db:"contact_user_id"`
	ContactUser   *users.User `json:"contact"`

	// Geographical Center - used for map view defaults
	Latitude  float64 `json:"lat" db:"lat"`
	Longitude float64 `json:"lon" db:"lon"`
}

func DescribeOrganization

func DescribeOrganization(ctx context.Context, db *sqlx.DB, organizationID int64) (*Organization, error)

func DescribeOrganizationBySlug

func DescribeOrganizationBySlug(ctx context.Context, db *sqlx.DB, slug string) (*Organization, error)

func ListOrganizations

func ListOrganizations(ctx context.Context, db *sqlx.DB) ([]Organization, error)

func New

func New() *Organization

func (*Organization) Create

func (o *Organization) Create(ctx context.Context, db *sqlx.DB) error

func (*Organization) Update

func (o *Organization) Update(ctx context.Context, db *sqlx.DB) error

func (Organization) Validate

func (o Organization) Validate() (errs *config.ErrorSet)

type OrganizationDbRow

type OrganizationDbRow struct {
	Id       uint64 `json:"id" db:"id"`
	Name     string `json:"name" db:"name"`
	Slug     string `json:"slug" db:"slug"`
	Authcode string `json:"authcode" db:"authcode"`

	// Contact info
	ContactUserId sql.NullInt64 `json:"contact_user_id" db:"contact_user_id"`

	// Geographical Center - used for map view defaults
	Latitude  float64 `json:"lat" db:"lat"`
	Longitude float64 `json:"lon" db:"lon"`
}

func (OrganizationDbRow) CopyToOrganization

func (row OrganizationDbRow) CopyToOrganization() *Organization

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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