rortest

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

TODO: Remove before merge

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseQuery

type DatabaseQuery struct {
	Sorts  []string            `json:"sorts,omitempty"`
	Query  *DatabaseQueryQuery `json:"query,omitempty"`
	Fields []string            `json:"fields,omitempty"`
}

func (DatabaseQuery) GetFields

func (db DatabaseQuery) GetFields() []string

func (DatabaseQuery) GetQuery

func (db DatabaseQuery) GetQuery() *DatabaseQueryQuery

func (DatabaseQuery) GetSorts

func (db DatabaseQuery) GetSorts() []string

func (*DatabaseQuery) SetField

func (db *DatabaseQuery) SetField(sort string) Queryinterface

func (*DatabaseQuery) SetQuery

func (db *DatabaseQuery) SetQuery(query *DatabaseQueryQuery) Queryinterface

func (*DatabaseQuery) SetSort

func (db *DatabaseQuery) SetSort(sort string) Queryinterface

type DatabaseQueryQuery

type DatabaseQueryQuery struct {
	UID             string `json:"uid,omitempty"`
	Kind            string `json:"kind,omitempty"`
	metav1.TypeMeta `json:",inline"`
	OwnerRef        rortypes.RorResourceOwnerReference `json:"owner_ref,omitempty"`
	Name            string                             `json:"name,omitempty"`
}

type Databaseprovider

type Databaseprovider interface {
	Query(Queryinterface) string
	Do(Queryinterface) []byte
}

func NewMongodbProvider

func NewMongodbProvider(client *mongo.Database) Databaseprovider

type Mongoprovider

type Mongoprovider struct {
	Client *mongo.Database
}

func (Mongoprovider) Do

func (mdb Mongoprovider) Do(query Queryinterface) []byte

func (Mongoprovider) Query

func (mdb Mongoprovider) Query(query Queryinterface) string

type Queryinterface

type Queryinterface interface {
	SetSort(string) Queryinterface
	GetSorts() []string
	SetQuery(*DatabaseQueryQuery) Queryinterface
	GetQuery() *DatabaseQueryQuery
	SetField(string) Queryinterface
	GetFields() []string
}

func NewQuery

func NewQuery() Queryinterface

Jump to

Keyboard shortcuts

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