Help us shape the future of Go! Take the 2026 Go Developer Survey

usage

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the usage type in the database.
	Label = "usage"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
	FieldUpdatedAt = "updated_at"
	// FieldWorkspaceID holds the string denoting the workspace_id field in the database.
	FieldWorkspaceID = "workspace_id"
	// FieldPeriodStart holds the string denoting the period_start field in the database.
	FieldPeriodStart = "period_start"
	// FieldMetric holds the string denoting the metric field in the database.
	FieldMetric = "metric"
	// FieldValue holds the string denoting the value field in the database.
	FieldValue = "value"
	// FieldFinalizedAt holds the string denoting the finalized_at field in the database.
	FieldFinalizedAt = "finalized_at"
	// FieldComputedAt holds the string denoting the computed_at field in the database.
	FieldComputedAt = "computed_at"
	// EdgeWorkspace holds the string denoting the workspace edge name in mutations.
	EdgeWorkspace = "workspace"
	// Table holds the table name of the usage in the database.
	Table = "usages"
	// WorkspaceTable is the table that holds the workspace relation/edge.
	WorkspaceTable = "usages"
	// WorkspaceInverseTable is the table name for the Workspace entity.
	// It exists in this package in order to avoid circular dependency with the "workspace" package.
	WorkspaceInverseTable = "workspaces"
	// WorkspaceColumn is the table column denoting the workspace relation/edge.
	WorkspaceColumn = "workspace_id"
)

Variables

View Source
var (
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
	DefaultUpdatedAt func() time.Time
	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
	UpdateDefaultUpdatedAt func() time.Time
	// MetricValidator is a validator for the "metric" field. It is called by the builders before save.
	MetricValidator func(string) error
	// DefaultValue holds the default value on creation for the "value" field.
	DefaultValue int64
	// ValueValidator is a validator for the "value" field. It is called by the builders before save.
	ValueValidator func(int64) error
)

Columns holds all SQL columns for usage fields.

Functions

func And

func And(predicates ...predicate.Usage) predicate.Usage

And groups predicates with the AND operator between them.

func ComputedAt

func ComputedAt(v time.Time) predicate.Usage

ComputedAt applies equality check predicate on the "computed_at" field. It's identical to ComputedAtEQ.

func ComputedAtEQ

func ComputedAtEQ(v time.Time) predicate.Usage

ComputedAtEQ applies the EQ predicate on the "computed_at" field.

func ComputedAtGT

func ComputedAtGT(v time.Time) predicate.Usage

ComputedAtGT applies the GT predicate on the "computed_at" field.

func ComputedAtGTE

func ComputedAtGTE(v time.Time) predicate.Usage

ComputedAtGTE applies the GTE predicate on the "computed_at" field.

func ComputedAtIn

func ComputedAtIn(vs ...time.Time) predicate.Usage

ComputedAtIn applies the In predicate on the "computed_at" field.

func ComputedAtLT

func ComputedAtLT(v time.Time) predicate.Usage

ComputedAtLT applies the LT predicate on the "computed_at" field.

func ComputedAtLTE

func ComputedAtLTE(v time.Time) predicate.Usage

ComputedAtLTE applies the LTE predicate on the "computed_at" field.

func ComputedAtNEQ

func ComputedAtNEQ(v time.Time) predicate.Usage

ComputedAtNEQ applies the NEQ predicate on the "computed_at" field.

func ComputedAtNotIn

func ComputedAtNotIn(vs ...time.Time) predicate.Usage

ComputedAtNotIn applies the NotIn predicate on the "computed_at" field.

func CreatedAt

func CreatedAt(v time.Time) predicate.Usage

CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Usage

CreatedAtEQ applies the EQ predicate on the "created_at" field.

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Usage

CreatedAtGT applies the GT predicate on the "created_at" field.

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Usage

CreatedAtGTE applies the GTE predicate on the "created_at" field.

func CreatedAtIn

func CreatedAtIn(vs ...time.Time) predicate.Usage

CreatedAtIn applies the In predicate on the "created_at" field.

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Usage

CreatedAtLT applies the LT predicate on the "created_at" field.

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Usage

CreatedAtLTE applies the LTE predicate on the "created_at" field.

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Usage

CreatedAtNEQ applies the NEQ predicate on the "created_at" field.

func CreatedAtNotIn

func CreatedAtNotIn(vs ...time.Time) predicate.Usage

CreatedAtNotIn applies the NotIn predicate on the "created_at" field.

func FinalizedAt

func FinalizedAt(v time.Time) predicate.Usage

FinalizedAt applies equality check predicate on the "finalized_at" field. It's identical to FinalizedAtEQ.

func FinalizedAtEQ

func FinalizedAtEQ(v time.Time) predicate.Usage

FinalizedAtEQ applies the EQ predicate on the "finalized_at" field.

func FinalizedAtGT

func FinalizedAtGT(v time.Time) predicate.Usage

FinalizedAtGT applies the GT predicate on the "finalized_at" field.

func FinalizedAtGTE

func FinalizedAtGTE(v time.Time) predicate.Usage

FinalizedAtGTE applies the GTE predicate on the "finalized_at" field.

func FinalizedAtIn

func FinalizedAtIn(vs ...time.Time) predicate.Usage

FinalizedAtIn applies the In predicate on the "finalized_at" field.

func FinalizedAtIsNil

func FinalizedAtIsNil() predicate.Usage

FinalizedAtIsNil applies the IsNil predicate on the "finalized_at" field.

func FinalizedAtLT

func FinalizedAtLT(v time.Time) predicate.Usage

FinalizedAtLT applies the LT predicate on the "finalized_at" field.

func FinalizedAtLTE

func FinalizedAtLTE(v time.Time) predicate.Usage

FinalizedAtLTE applies the LTE predicate on the "finalized_at" field.

func FinalizedAtNEQ

func FinalizedAtNEQ(v time.Time) predicate.Usage

FinalizedAtNEQ applies the NEQ predicate on the "finalized_at" field.

func FinalizedAtNotIn

func FinalizedAtNotIn(vs ...time.Time) predicate.Usage

FinalizedAtNotIn applies the NotIn predicate on the "finalized_at" field.

func FinalizedAtNotNil

func FinalizedAtNotNil() predicate.Usage

FinalizedAtNotNil applies the NotNil predicate on the "finalized_at" field.

func HasWorkspace

func HasWorkspace() predicate.Usage

HasWorkspace applies the HasEdge predicate on the "workspace" edge.

func HasWorkspaceWith

func HasWorkspaceWith(preds ...predicate.Workspace) predicate.Usage

HasWorkspaceWith applies the HasEdge predicate on the "workspace" edge with a given conditions (other predicates).

func ID

func ID(id int64) predicate.Usage

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int64) predicate.Usage

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int64) predicate.Usage

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int64) predicate.Usage

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...int64) predicate.Usage

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int64) predicate.Usage

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int64) predicate.Usage

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int64) predicate.Usage

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...int64) predicate.Usage

IDNotIn applies the NotIn predicate on the ID field.

func Metric

func Metric(v string) predicate.Usage

Metric applies equality check predicate on the "metric" field. It's identical to MetricEQ.

func MetricContains

func MetricContains(v string) predicate.Usage

MetricContains applies the Contains predicate on the "metric" field.

func MetricContainsFold

func MetricContainsFold(v string) predicate.Usage

MetricContainsFold applies the ContainsFold predicate on the "metric" field.

func MetricEQ

func MetricEQ(v string) predicate.Usage

MetricEQ applies the EQ predicate on the "metric" field.

func MetricEqualFold

func MetricEqualFold(v string) predicate.Usage

MetricEqualFold applies the EqualFold predicate on the "metric" field.

func MetricGT

func MetricGT(v string) predicate.Usage

MetricGT applies the GT predicate on the "metric" field.

func MetricGTE

func MetricGTE(v string) predicate.Usage

MetricGTE applies the GTE predicate on the "metric" field.

func MetricHasPrefix

func MetricHasPrefix(v string) predicate.Usage

MetricHasPrefix applies the HasPrefix predicate on the "metric" field.

func MetricHasSuffix

func MetricHasSuffix(v string) predicate.Usage

MetricHasSuffix applies the HasSuffix predicate on the "metric" field.

func MetricIn

func MetricIn(vs ...string) predicate.Usage

MetricIn applies the In predicate on the "metric" field.

func MetricLT

func MetricLT(v string) predicate.Usage

MetricLT applies the LT predicate on the "metric" field.

func MetricLTE

func MetricLTE(v string) predicate.Usage

MetricLTE applies the LTE predicate on the "metric" field.

func MetricNEQ

func MetricNEQ(v string) predicate.Usage

MetricNEQ applies the NEQ predicate on the "metric" field.

func MetricNotIn

func MetricNotIn(vs ...string) predicate.Usage

MetricNotIn applies the NotIn predicate on the "metric" field.

func Not

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.Usage) predicate.Usage

Or groups predicates with the OR operator between them.

func PeriodStart

func PeriodStart(v time.Time) predicate.Usage

PeriodStart applies equality check predicate on the "period_start" field. It's identical to PeriodStartEQ.

func PeriodStartEQ

func PeriodStartEQ(v time.Time) predicate.Usage

PeriodStartEQ applies the EQ predicate on the "period_start" field.

func PeriodStartGT

func PeriodStartGT(v time.Time) predicate.Usage

PeriodStartGT applies the GT predicate on the "period_start" field.

func PeriodStartGTE

func PeriodStartGTE(v time.Time) predicate.Usage

PeriodStartGTE applies the GTE predicate on the "period_start" field.

func PeriodStartIn

func PeriodStartIn(vs ...time.Time) predicate.Usage

PeriodStartIn applies the In predicate on the "period_start" field.

func PeriodStartLT

func PeriodStartLT(v time.Time) predicate.Usage

PeriodStartLT applies the LT predicate on the "period_start" field.

func PeriodStartLTE

func PeriodStartLTE(v time.Time) predicate.Usage

PeriodStartLTE applies the LTE predicate on the "period_start" field.

func PeriodStartNEQ

func PeriodStartNEQ(v time.Time) predicate.Usage

PeriodStartNEQ applies the NEQ predicate on the "period_start" field.

func PeriodStartNotIn

func PeriodStartNotIn(vs ...time.Time) predicate.Usage

PeriodStartNotIn applies the NotIn predicate on the "period_start" field.

func UpdatedAt

func UpdatedAt(v time.Time) predicate.Usage

UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.Usage

UpdatedAtEQ applies the EQ predicate on the "updated_at" field.

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.Usage

UpdatedAtGT applies the GT predicate on the "updated_at" field.

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.Usage

UpdatedAtGTE applies the GTE predicate on the "updated_at" field.

func UpdatedAtIn

func UpdatedAtIn(vs ...time.Time) predicate.Usage

UpdatedAtIn applies the In predicate on the "updated_at" field.

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.Usage

UpdatedAtLT applies the LT predicate on the "updated_at" field.

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.Usage

UpdatedAtLTE applies the LTE predicate on the "updated_at" field.

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.Usage

UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.

func UpdatedAtNotIn

func UpdatedAtNotIn(vs ...time.Time) predicate.Usage

UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.

func ValidColumn

func ValidColumn(column string) bool

ValidColumn reports if the column name is valid (part of the table columns).

func Value

func Value(v int64) predicate.Usage

Value applies equality check predicate on the "value" field. It's identical to ValueEQ.

func ValueEQ

func ValueEQ(v int64) predicate.Usage

ValueEQ applies the EQ predicate on the "value" field.

func ValueGT

func ValueGT(v int64) predicate.Usage

ValueGT applies the GT predicate on the "value" field.

func ValueGTE

func ValueGTE(v int64) predicate.Usage

ValueGTE applies the GTE predicate on the "value" field.

func ValueIn

func ValueIn(vs ...int64) predicate.Usage

ValueIn applies the In predicate on the "value" field.

func ValueLT

func ValueLT(v int64) predicate.Usage

ValueLT applies the LT predicate on the "value" field.

func ValueLTE

func ValueLTE(v int64) predicate.Usage

ValueLTE applies the LTE predicate on the "value" field.

func ValueNEQ

func ValueNEQ(v int64) predicate.Usage

ValueNEQ applies the NEQ predicate on the "value" field.

func ValueNotIn

func ValueNotIn(vs ...int64) predicate.Usage

ValueNotIn applies the NotIn predicate on the "value" field.

func WorkspaceID

func WorkspaceID(v int64) predicate.Usage

WorkspaceID applies equality check predicate on the "workspace_id" field. It's identical to WorkspaceIDEQ.

func WorkspaceIDEQ

func WorkspaceIDEQ(v int64) predicate.Usage

WorkspaceIDEQ applies the EQ predicate on the "workspace_id" field.

func WorkspaceIDIn

func WorkspaceIDIn(vs ...int64) predicate.Usage

WorkspaceIDIn applies the In predicate on the "workspace_id" field.

func WorkspaceIDNEQ

func WorkspaceIDNEQ(v int64) predicate.Usage

WorkspaceIDNEQ applies the NEQ predicate on the "workspace_id" field.

func WorkspaceIDNotIn

func WorkspaceIDNotIn(vs ...int64) predicate.Usage

WorkspaceIDNotIn applies the NotIn predicate on the "workspace_id" field.

Types

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the Usage queries.

func ByComputedAt

func ByComputedAt(opts ...sql.OrderTermOption) OrderOption

ByComputedAt orders the results by the computed_at field.

func ByCreatedAt

func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption

ByCreatedAt orders the results by the created_at field.

func ByFinalizedAt

func ByFinalizedAt(opts ...sql.OrderTermOption) OrderOption

ByFinalizedAt orders the results by the finalized_at field.

func ByID

func ByID(opts ...sql.OrderTermOption) OrderOption

ByID orders the results by the id field.

func ByMetric

func ByMetric(opts ...sql.OrderTermOption) OrderOption

ByMetric orders the results by the metric field.

func ByPeriodStart

func ByPeriodStart(opts ...sql.OrderTermOption) OrderOption

ByPeriodStart orders the results by the period_start field.

func ByUpdatedAt

func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption

ByUpdatedAt orders the results by the updated_at field.

func ByValue

func ByValue(opts ...sql.OrderTermOption) OrderOption

ByValue orders the results by the value field.

func ByWorkspaceField

func ByWorkspaceField(field string, opts ...sql.OrderTermOption) OrderOption

ByWorkspaceField orders the results by workspace field.

func ByWorkspaceID

func ByWorkspaceID(opts ...sql.OrderTermOption) OrderOption

ByWorkspaceID orders the results by the workspace_id field.

Jump to

Keyboard shortcuts

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