organizations

package
v0.0.0-...-6a802dc Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Controller

func Controller(orgr *Repository) func(r *gin.Engine) *gin.RouterGroup

func Find

func Find(orgr *Repository) gin.HandlerFunc

func FindOne

func FindOne(orgr *Repository) gin.HandlerFunc

Types

type FindResponseModel

type FindResponseModel struct {
	Slug      string     `json:"slug"`
	Name      string     `json:"name"`
	CreatedAt *time.Time `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
}

func NewFindResponseModel

func NewFindResponseModel(rows *sql.Rows) []*FindResponseModel

type Model

type Model struct {
	ID        string     `json:"id"`
	Key       string     `json:"key"`
	Slug      string     `json:"slug"`
	Name      string     `json:"name"`
	CreatedAt *time.Time `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
}

func NewModel

func NewModel(rows *sql.Rows) *Model

func NewModels

func NewModels(rows *sql.Rows) []*Model

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository(conn *sql.DB) *Repository

func (*Repository) Find

func (self *Repository) Find(p *page.Page) ([]*FindResponseModel, int)

func (*Repository) FindById

func (self *Repository) FindById(id string) *Model

func (*Repository) FindBySlug

func (self *Repository) FindBySlug(slug string) *Model

func (*Repository) Upsert

func (self *Repository) Upsert(id string, key string, slug string, name string, createdAt time.Time, updatedAt time.Time)

type Seed

type Seed struct {
	Organizations []Model `json:"organizations"`
}

func NewSeed

func NewSeed() *Seed

Jump to

Keyboard shortcuts

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