ssd

package
v0.0.0-...-abaf530 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolQuery

type BoolQuery struct {
	Bool BoolQueryParams `json:"bool"`
}

BoolQuery Elastic bool query

type BoolQueryParams

type BoolQueryParams struct {
	Must               []interface{} `json:"must,omitempty"`
	Should             []interface{} `json:"should,omitempty"`
	Filter             []interface{} `json:"filter,omitempty"`
	MinimumShouldMatch int           `json:"minimum_should_match,omitempty"`
}

BoolQueryParams params for an Elastic bool query

type Controller

type Controller struct {
	Manufacturer string `json:"mfgr"`
	Name         string `json:"name"`
	NameShort    string `json:"nameShort"`
	Channels     string `json:"channels"`
}

type EsRepository

type EsRepository struct {
	EsClient *elasticsearch.Client
	Index    string
}

func NewEsRepository

func NewEsRepository(esClient *elasticsearch.Client, index string) *EsRepository

func (*EsRepository) FindById

func (esRepo *EsRepository) FindById(ctx context.Context, driveId string) (*SSD, error)

func (*EsRepository) Insert

func (esRepo *EsRepository) Insert(ctx context.Context, ssd SSD) error

func (*EsRepository) Search

func (esRepo *EsRepository) Search(ctx context.Context, searchQuery string) ([]SSD, error)

func (*EsRepository) SearchBasic

func (esRepo *EsRepository) SearchBasic(ctx context.Context, s string) ([]SSDBasic, error)

func (*EsRepository) Update

func (esRepo *EsRepository) Update(ctx context.Context, ssd SSD) error

type Flash

type Flash struct {
	Manufacturer string `json:"mfgr"`
	Name         string `json:"name"`
	Type         string `json:"type"`
	Layers       string `json:"layers"`
}

type Repository

type Repository interface {
	FindById(ctx context.Context, id string) (*SSD, error)
	Insert(ctx context.Context, ssd SSD) error
	Update(ctx context.Context, ssd SSD) error
	SearchBasic(ctx context.Context, s string) ([]SSDBasic, error)
	Search(ctx context.Context, s string) ([]SSD, error)
}

type SSD

type SSD struct {
	DriveID      string     `json:"driveId"`
	URL          string     `json:"url"`
	Manufacturer string     `json:"mfgr"`
	Name         string     `json:"name"`
	Capacity     string     `json:"capacity"`
	FormFactor   string     `json:"formFactor"`
	Interface    string     `json:"interface"`
	Protocol     string     `json:"protocol"`
	Dram         string     `json:"dram"`
	Hmb          string     `json:"hmb"`
	Released     string     `json:"released"`
	Endurance    string     `json:"endurance"`
	Warranty     string     `json:"warranty"`
	SeqRead      string     `json:"seqRead"`
	SeqWrite     string     `json:"seqWrite"`
	Controller   Controller `json:"controller"`
	Flash        Flash      `json:"flash"`
}

func (SSD) ToMarkdown

func (ssd SSD) ToMarkdown() string

ToMarkdown converts SSD to Markdown format to support formatting in a reddit comment submission

type SSDBasic

type SSDBasic struct {
	DriveID      string `json:"driveId"`
	Manufacturer string `json:"mfgr"`
	Name         string `json:"name"`
	Capacity     string `json:"capacity"`
	FormFactor   string `json:"formFactor"`
}

type TpuRepository

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

func NewTpuRepository

func NewTpuRepository(host, username, apiKey string) *TpuRepository

func (*TpuRepository) FindById

func (tpu *TpuRepository) FindById(ctx context.Context, id string) (*SSD, error)

func (*TpuRepository) Insert

func (tpu *TpuRepository) Insert(ctx context.Context, ssd SSD) error

func (*TpuRepository) Search

func (tpu *TpuRepository) Search(ctx context.Context, s string) ([]SSD, error)

func (*TpuRepository) SearchBasic

func (tpu *TpuRepository) SearchBasic(ctx context.Context, s string) ([]SSDBasic, error)

func (*TpuRepository) Update

func (tpu *TpuRepository) Update(ctx context.Context, ssd SSD) error

Jump to

Keyboard shortcuts

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