database

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Id      primitive.ObjectID      `bson:"_id"`
	Name    string                  `bson:"name"`
	Host    string                  `bson:"host,omitempty"`
	Status  apiPb.ApplicationStatus `bson:"status"`
	AgentId string                  `bson:"agentId,omitempty"`
}

type Database

type Database interface {
	FindOrCreate(ctx context.Context, name string, host string, agentId string) (*Application, error)
	FindApplicationByName(ctx context.Context, name string) (*Application, error)
	FindApplicationById(ctx context.Context, id primitive.ObjectID) (*Application, error)
	FindAllApplication(ctx context.Context) ([]*Application, error)
	FindApplicationByAgentId(ctx context.Context, agentId primitive.ObjectID) ([]*Application, error)
	SetStatus(ctx context.Context, id primitive.ObjectID, status apiPb.ApplicationStatus) error
}

func New

func New(connector mongo_helper.Connector) Database

Jump to

Keyboard shortcuts

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