database

package
v0.0.0-...-950e6cb Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLicenseDataBase     = "sealos-license"
	DefaultLicenseCollection   = "license"
	DefaultClusterIDCollection = "cluster-id"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataBase

type DataBase struct {
	URI    string
	Client *mongo.Client
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, uri string) (*DataBase, error)

func (*DataBase) Disconnect

func (db *DataBase) Disconnect(ctx context.Context)

func (*DataBase) GetClusterID

func (db *DataBase) GetClusterID(ctx context.Context) (string, error)

func (*DataBase) GetLicenseMeta

func (db *DataBase) GetLicenseMeta(ctx context.Context, token string) (*meta.Meta, error)

func (*DataBase) StoreClusterID

func (db *DataBase) StoreClusterID(ctx context.Context, clusterID string) error

func (*DataBase) StoreLicenseMeta

func (db *DataBase) StoreLicenseMeta(ctx context.Context, meta *meta.Meta) error

Jump to

Keyboard shortcuts

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