types

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UsernameMaxLength        = 255
	UserProfileNameMaxLength = 255
	UserSearchMaxLength      = 1024
)
View Source
const (
	ProjectNameMaxLength   = 255
	ClientNameMaxLength    = 255
	ProjectSearchMaxLength = 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddClientForm

type AddClientForm struct {
	ClientName string `json:"clientName" form:"clientName" validate:"required"`
	ProjectId  string `json:"projectId" form:"projectId" validate:"required"`
}

type ApiError

type ApiError struct {
	Message string            `json:"message"`
	Fields  map[string]string `json:"fields"`
	// contains filtered or unexported fields
}

func NewApiError

func NewApiError(message string, fields ...map[string]string) ApiError

func (ApiError) Error

func (e ApiError) Error() string

type Client

type Client struct {
	ClientId string `json:"clientId"`
	Project  string `json:"project"`
}

type CommaSeparatedStrings

type CommaSeparatedStrings []string

CommaSeparatedStrings is a custom type for handling comma-separated values from selectbox component. It implements echo.BindUnmarshaler to split comma-separated strings into a slice. This is needed because the templui selectbox component sends multiple values as "val1,val2,val3" instead of multiple form fields with the same name.

func (*CommaSeparatedStrings) UnmarshalParam

func (css *CommaSeparatedStrings) UnmarshalParam(param string) error

func (*CommaSeparatedStrings) UnmarshalParams

func (css *CommaSeparatedStrings) UnmarshalParams(params []string) error

UnmarshalParam implements echo's BindUnmarshaler interface for custom form binding. It splits comma-separated values into a string slice. UnmarshalParams accepts repeated fields and comma-separated values. shadcn-templ's multiple combobox submits one input per value; the v1 selectbox submitted one comma-separated field.

type CreateProjectForm

type CreateProjectForm struct {
	ID      string   `json:"id" form:"id"`
	Name    string   `json:"name" form:"name" validate:"required,gte=3"`
	Clients []string `json:"clients" form:"clients"`
}

type CreateUserForm

type CreateUserForm struct {
	ID         string                `json:"id" form:"id"`
	Username   string                `json:"username" form:"username" validate:"required,gte=3"`
	FirstName  string                `json:"firstName" form:"firstName" validate:"required,gte=3"`
	LastName   string                `json:"lastName" form:"lastName" validate:"required,gte=3"`
	Role       string                `json:"role" form:"role" validate:"required,oneof=user admin"`
	ProjectIDs CommaSeparatedStrings `json:"projects" form:"projects"`
	Projects   []combobox.Option     `json:"-" form:"-"`
}

type FormBool

type FormBool bool

func (FormBool) Bool

func (b FormBool) Bool() bool

func (*FormBool) UnmarshalParam

func (b *FormBool) UnmarshalParam(param string) error

type GetProjectPageInput

type GetProjectPageInput struct {
	Search string `json:"search" query:"search"`
	Page   int64  `json:"page" query:"page" default:"0" validate:"gte=0"`
	Size   int64  `json:"size" query:"size" default:"10" validate:"gte=1,lte=100"`
}

type GetUserPageInput

type GetUserPageInput struct {
	Page   int64  `json:"page" query:"page" default:"0" validate:"gte=0"`
	Size   int64  `json:"size" query:"size" default:"10" validate:"gte=1,lte=100"`
	Search string `json:"search" query:"search"`
}

type LoginForm

type LoginForm struct {
	Username string `json:"username" form:"username" validate:"required,gte=3"`
	Password string `json:"password" form:"password" validate:"required,gte=8"`
	Redirect string `json:"redirect" form:"redirect"`
}

type LoginFormWithToken

type LoginFormWithToken struct {
	Token string `json:"token" form:"token" query:"token" validate:"required,gte=5"`
}

type NullableDate

type NullableDate struct {
	Time  time.Time
	Valid bool
}

NullableDate is a custom type for handling optional date inputs from forms. It implements echo.BindUnmarshaler to support multiple date formats.

func (*NullableDate) UnmarshalParam

func (nd *NullableDate) UnmarshalParam(param string) error

UnmarshalParam implements echo's BindUnmarshaler interface for custom form binding. An empty value means no expiry. YYYY-MM-DD is a UTC calendar day and is stored as the exclusive end of that day, the start of the next UTC day, so the selected day remains valid through its end. RFC3339 values stay absolute instants.

type ProjectDto

type ProjectDto struct {
	ID          uuid.UUID `json:"id"`
	Name        string    `bson:"name" json:"name"`
	Clients     []string  `bson:"clients" json:"clients"`
	StorageSize int64     `json:"storageSize"`
}

type RemoveClientForm

type RemoveClientForm struct {
	ClientId  string `json:"clientId" form:"clientId" validate:"required"`
	ProjectId string `json:"projectId" form:"projectId" validate:"required"`
}

type ResetPasswordForm

type ResetPasswordForm struct {
	Password         string `json:"password" form:"password" validate:"required,gte=8"`
	RepeatedPassword string `json:"repeatedPassword" form:"repeatedPassword" validate:"required,gte=8"`
}

type ServerEnv

type ServerEnv struct {
	LogLevel                      string        `env:"LOG_LEVEL" envDefault:"info"`
	PostgresURL                   string        `env:"POSTGRES_URL" envDefault:"postgres://svarog:svarog@localhost:5434/svarog?sslmode=disable"`
	ServerDnsName                 string        `env:"SERVER_DNS_NAME"`
	HttpServerPort                int           `env:"HTTP_SERVER_PORT"`
	SessionSecret                 string        `env:"SESSION_SECRET"`
	ArchiveDir                    string        `env:"ARCHIVE_DIR"`
	ArchiveSchedulerEnabled       bool          `env:"ARCHIVE_SCHEDULER_ENABLED" envDefault:"true"`
	IngestStreamMaxBytes          int64         `env:"INGEST_STREAM_MAX_BYTES" envDefault:"0"`
	IngestAckWait                 time.Duration `env:"INGEST_ACK_WAIT" envDefault:"60s"`
	IngestAllowRetentionMigration bool          `env:"INGEST_ALLOW_RETENTION_MIGRATION" envDefault:"false"`

	ArchiveS3Bucket          string `env:"ARCHIVE_S3_BUCKET"`
	ArchiveS3Endpoint        string `env:"ARCHIVE_S3_ENDPOINT"`
	ArchiveS3Region          string `env:"ARCHIVE_S3_REGION" envDefault:"auto"`
	ArchiveS3AccessKeyID     string `env:"ARCHIVE_S3_ACCESS_KEY_ID"`
	ArchiveS3SecretAccessKey string `env:"ARCHIVE_S3_SECRET_ACCESS_KEY"`

	NatsPublicAddr     string `env:"NATS_PUBLIC_ADDR"`
	NatsAddr           string `env:"NATS_ADDR"`
	NatsAccountSeed    string `env:"NATS_ACCOUNT_SEED"`
	NatsServerUserJWT  string `env:"NATS_SERVER_USER_JWT"`
	NatsServerUserSeed string `env:"NATS_SERVER_USER_SEED"`
}

type StoredClient

type StoredClient struct {
	ProjectId  string `bson:"project_id" json:"projectId"`
	ClientId   string `bson:"client_id" json:"clientId"`
	InstanceId string `bson:"instance_id" json:"instanceId"`
}

type StoredLog

type StoredLog struct {
	ID             int64        `bson:"_id,omitempty"`
	LogLine        string       `bson:"log_line"`
	Timestamp      time.Time    `bson:"timestamp"`
	Client         StoredClient `bson:"client"`
	SequenceNumber int          `bson:"sequence_number"`
}

Jump to

Keyboard shortcuts

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