models

package
v0.31.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: GPL-2.0 Imports: 2 Imported by: 4

Documentation

Overview

Package models provides the object models for haul requests and responses

Index

Constants

View Source
const Schema = `` /* 672-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	ID          int64      `db:"id, omitempty" json:"id"`
	Description string     `db:"description" json:"description"`
	Status      string     `db:"status" json:"status"`
	Target      int64      `db:"target" json:"target"`
	CreatedAt   *time.Time `db:"created_at" json:"created_at"`
	DeletedAt   *time.Time `db:"deleted_at, omitempty" json:"deleted_at"`
}

type AssetTag

type AssetTag struct {
	AssetID int64 `db:"asset_id" json:"asset_id"`
	TagID   int64 `db:"tag_id" json:"tag_id"`
}

type Assets

type Assets struct {
	Assets []Asset
}

func (Assets) TabbyPrint

func (assets Assets) TabbyPrint() error

type ClientConfig

type ClientConfig struct {
	Cli struct {
		Style string `json:"style"`
	} `json:"cli"`
	Api struct {
		Host     string `json:"host"`
		Key      string `json:"key"`
		Protocol string `json:"protocol"`
		Port     int    `json:"port"`
	} `json:"api"`
}

Struct ClientConfig holds config options needed by a client. Example uses are:

  • Cli output style
  • Remote (or local) API connection informations

type Config

type Config struct {
	// Client configuration
	Client ClientConfig `json:"client"`

	// Server configuration
	Server ServerConfig `json:"server"`
}

Struct Config is used as the primary target for viper.Unmarshal() in haul

It tries to contain all possible configuration options, and will apply the proper defaults set by cobra.

Config options are split between Config.Server and Config.Client.

type Event

type Event struct {
	ID      int64      `db:"id, omitempty" json:"id"`
	At      *time.Time `db:"at" json:"at"`
	Content string     `db:"content" json:"content"`
}

type Events

type Events struct {
	Events []Event
}

func (Events) TabbyPrint

func (events Events) TabbyPrint() error

type ServerConfig

type ServerConfig struct {
	Api struct {
		Key  string `json:"key"`
		Port int    `json:"port"`
		TLS  struct {
			Enabled bool   `json:"enabled"`
			Cert    string `json:"cert"`
			Key     string `json:"key"`
		} `json:"tls"`
	} `json:"api"`
	Postgres struct {
		Database   string `json:"database"`
		Host       string `json:"host"`
		Password   string `json:"password"`
		Port       int    `json:"port"`
		User       string `json:"user"`
		SSLEnabled bool   `json:"ssl_enabled"`
	} `json:"postgres"`
}

Struct ServerConfig holds config options needed by a server. Examples uses are:

  • API server configurations for hosting
  • Database connection informations

type TabbyPrinter

type TabbyPrinter interface {
	TabbyPrint() error
}

type Tag

type Tag struct {
	ID        int64      `db:"id, omitempty" json:"id"`
	Key       string     `db:"key" json:"key"`
	Value     string     `db:"value" json:"value"`
	CreatedAt *time.Time `db:"created_at" json:"created_at"`
	DeletedAt *time.Time `db:"deleted_at, omitempty" json:"deleted_at"`
}

type Tags

type Tags struct {
	Tags []Tag
}

func (Tags) TabbyPrint

func (tags Tags) TabbyPrint() error

Jump to

Keyboard shortcuts

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