models

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Count

type Count struct {
	ID        uint      `gorm:"primarykey" json:"id"`
	CreatedAt time.Time `json:"created_at"`

	// Relations
	CounterID uint    `json:"counter_id"`
	Counter   Counter `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"counter"`
}

Count is a model struct for count.

func (*Count) TableName

func (b *Count) TableName() string

TableName defines table name for Counter.

type CountGroupResult

type CountGroupResult struct {
	Count int64     `json:"count"`
	Date  time.Time `json:"date"`
}

CountGroupResult is a grouped result of Count.

type Counter

type Counter struct {
	ID        uint      `gorm:"primarykey" json:"id"`
	Name      string    `gorm:"type:varchar(100);not null" json:"name"`
	Count     uint      `json:"count"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	// Relations
	NamespaceID uint      `json:"namespace_id"`
	Namespace   Namespace `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"namespace"`
}

Counter is a model struct for counter.

func (*Counter) TableName

func (b *Counter) TableName() string

TableName defines table name for Counter.

type Namespace added in v0.10.0

type Namespace struct {
	ID        uint      `gorm:"primarykey" json:"id"`
	Name      string    `gorm:"type:varchar(100);unique_index;not null;unique" json:"name"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

Namespace is a model struct for counter.

func (*Namespace) TableName added in v0.10.0

func (b *Namespace) TableName() string

TableName defines table name for Namespace.

Jump to

Keyboard shortcuts

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