api

package
v0.0.43 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: GPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	User             *authentication.User
	Config           *configuration.Configuration
	Keys             *keys.Keys
	DnsCache         *dns.Records
	Badger           *badger.DB
	BadgerSync       *sync.RWMutex
	RelationRegistry *relations.RelationRegistry
	Manager          *manager.Manager
	VersionServer    string
}

func NewApi

func NewApi(config *configuration.Configuration, badger *badger.DB) *Api

func (*Api) Apply

func (api *Api) Apply(c *gin.Context)

func (*Api) Compare

func (api *Api) Compare(c *gin.Context)

func (*Api) CreateUser added in v0.0.10

func (api *Api) CreateUser(c *gin.Context)

func (*Api) DatabaseGet

func (api *Api) DatabaseGet(c *gin.Context)

DatabaseGet godoc

@Summary		Get value from the key-value store
@Description	get string by key from the key-value store
@Tags			database
@Produce		json
@Param			key	path		string	true	"RandomKey"
@Success		200	{object}	  httpcontract.ResponseOperator
@Failure		400	{object}	  httpcontract.ResponseOperator
@Failure		404	{object}	  httpcontract.ResponseOperator
@Failure		500	{object}	  httpcontract.ResponseOperator
@Router			/database/{key} [get]

func (*Api) DatabaseGetKeys

func (api *Api) DatabaseGetKeys(c *gin.Context)

DatabaseGetKeys godoc

@Summary		Get keys by prefix in the key-value store
@Description	get all keys by prefix in the key-value store
@Tags			database
@Produce		json
@Success		200	{object}	  httpcontract.ResponseOperator
@Failure		400	{object}	  httpcontract.ResponseOperator
@Failure		404	{object}	  httpcontract.ResponseOperator
@Failure		500	{object}	  httpcontract.ResponseOperator
@Router			/database/keys [get]

func (*Api) DatabaseGetKeysPrefix

func (api *Api) DatabaseGetKeysPrefix(c *gin.Context)

DatabaseGetKeysPrefix godoc

@Summary		Get keys by prefix in the key-value store
@Description	get all keys by prefix in the key-value store
@Tags			database
@Produce		json
@Success		200	{object}	  httpcontract.ResponseOperator
@Failure		400	{object}	  httpcontract.ResponseOperator
@Failure		404	{object}	  httpcontract.ResponseOperator
@Failure		500	{object}	  httpcontract.ResponseOperator
@Router			/database/{key}/{prefix} [get]

func (*Api) DatabaseRemoveKeys

func (api *Api) DatabaseRemoveKeys(c *gin.Context)

DatabaseRemoveKeys godoc

@Summary		Remove keys by prefix in the key-value store
@Description	remove all keys by prefix in the key-value store
@Tags			database
@Produce		json
@Success		200	{object}	  httpcontract.ResponseOperator
@Failure		400	{object}	  httpcontract.ResponseOperator
@Failure		404	{object}	  httpcontract.ResponseOperator
@Failure		500	{object}	  httpcontract.ResponseOperator
@Router			/database/keys [delete]

func (*Api) DatabaseSet

func (api *Api) DatabaseSet(c *gin.Context)

DatabaseSet godoc

@Summary		Set value in the key-value store
@Description	set string by key in the key-value store
@Tags			database
@Accepts		json
@Produce		json
@Param			key		path		string	true	"RandomKey"
@Param			value	body		Kv		true	"value"
@Success		200		{object}	  httpcontract.ResponseOperator
@Failure		400		{object}	  httpcontract.ResponseOperator
@Failure		404		{object}	  httpcontract.ResponseOperator
@Failure		500		{object}	  httpcontract.ResponseOperator
@Router			/database/{key} [post]

func (*Api) Definition added in v0.0.3

func (api *Api) Definition(c *gin.Context)

func (*Api) Definitions added in v0.0.3

func (api *Api) Definitions(c *gin.Context)

func (*Api) Delete

func (api *Api) Delete(c *gin.Context)

func (*Api) HandleDns

func (api *Api) HandleDns(w mdns.ResponseWriter, r *mdns.Msg)

func (*Api) Health

func (api *Api) Health(c *gin.Context)

func (*Api) ImplementationWrapperApply

func (api *Api) ImplementationWrapperApply(user *authentication.User, kind string, jsonData []byte, c *gin.Context)

func (*Api) ImplementationWrapperCompare

func (api *Api) ImplementationWrapperCompare(user *authentication.User, kind string, jsonData []byte, c *gin.Context)

func (*Api) ImplementationWrapperDelete

func (api *Api) ImplementationWrapperDelete(user *authentication.User, kind string, jsonData []byte, c *gin.Context)

func (*Api) ListDns added in v0.0.3

func (api *Api) ListDns(c *gin.Context)

func (*Api) ListSupported

func (api *Api) ListSupported(c *gin.Context)

func (*Api) Logs

func (api *Api) Logs(c *gin.Context)

func (*Api) Ps

func (api *Api) Ps(c *gin.Context)

func (*Api) Restore added in v0.0.2

func (api *Api) Restore(c *gin.Context)

func (*Api) RunOperators

func (api *Api) RunOperators(c *gin.Context)

func (*Api) SecretsGet

func (api *Api) SecretsGet(c *gin.Context)

SecretsGet godoc

@Summary		Get value from the key-value store
@Description	get string by key from the key-value store
@Tags			database
@Produce		json
@Param			key	path		string	true	"RandomKey"
@Success		200	{object}	httpcontract.ResponseOperator
@Failure		400	{object}	httpcontract.ResponseOperator
@Failure		404	{object}	httpcontract.ResponseOperator
@Failure		500	{object}	httpcontract.ResponseOperator
@Router			/database/{key} [get]

func (*Api) SecretsGetKeys

func (api *Api) SecretsGetKeys(c *gin.Context)

SecretsGetKeys godoc

@Summary		Get keys by prefix in the key-value store
@Description	get all keys by prefix in the key-value store
@Tags			database
@Produce		json
@Success		200	{object}	httpcontract.ResponseOperator
@Failure		400	{object}	httpcontract.ResponseOperator
@Failure		404	{object}	httpcontract.ResponseOperator
@Failure		500	{object}	httpcontract.ResponseOperator
@Router			/database/keys [get]

func (*Api) SecretsSet

func (api *Api) SecretsSet(c *gin.Context)

SecretsSet godoc

@Summary		Set value in the key-value store
@Description	set string by key in the key-value store
@Tags			database
@Accepts		json
@Produce		json
@Param			key		path		string	true	"RandomKey"
@Param			value	body		Kv		true	"value"
@Success		200		{object}	httpcontract.ResponseOperator
@Failure		400		{object}	httpcontract.ResponseOperator
@Failure		404		{object}	httpcontract.ResponseOperator
@Failure		500		{object}	httpcontract.ResponseOperator
@Router			/database/{key} [post]

func (*Api) SetupEncryptedDatabase

func (api *Api) SetupEncryptedDatabase(masterKey []byte)

func (*Api) Version added in v0.0.3

func (api *Api) Version(c *gin.Context)

type Kv

type Kv struct {
	Value string
	User  string
}

Jump to

Keyboard shortcuts

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