api

package
v0.0.57 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: GPL-3.0 Imports: 45 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

	Cluster       *cluster.Cluster
	BadgerSync    *sync.RWMutex
	Kinds         *relations.RelationRegistry
	KindsRegistry map[string]contracts.Kind
	Manager       *manager.Manager
	VersionServer string
	// contains filtered or unexported fields
}

func NewApi

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

func (*Api) AddNode added in v0.0.57

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

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}	  contracts.ResponseOperator
@Failure		400	{object}	  contracts.ResponseOperator
@Failure		404	{object}	  contracts.ResponseOperator
@Failure		500	{object}	  contracts.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}	  contracts.ResponseOperator
@Failure		400	{object}	  contracts.ResponseOperator
@Failure		404	{object}	  contracts.ResponseOperator
@Failure		500	{object}	  contracts.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}	  contracts.ResponseOperator
@Failure		400	{object}	  contracts.ResponseOperator
@Failure		404	{object}	  contracts.ResponseOperator
@Failure		500	{object}	  contracts.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}	  contracts.ResponseOperator
@Failure		400	{object}	  contracts.ResponseOperator
@Failure		404	{object}	  contracts.ResponseOperator
@Failure		500	{object}	  contracts.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}	  contracts.ResponseOperator
@Failure		400		{object}	  contracts.ResponseOperator
@Failure		404		{object}	  contracts.ResponseOperator
@Failure		500		{object}	  contracts.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) EtcdDelete added in v0.0.57

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

func (*Api) EtcdPut added in v0.0.57

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

func (*Api) GetCluster added in v0.0.57

func (api *Api) GetCluster(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) RemoveNode added in v0.0.57

func (api *Api) RemoveNode(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) SaveClusterConfiguration added in v0.0.57

func (api *Api) SaveClusterConfiguration()

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}	contracts.ResponseOperator
@Failure		400	{object}	contracts.ResponseOperator
@Failure		404	{object}	contracts.ResponseOperator
@Failure		500	{object}	contracts.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}	contracts.ResponseOperator
@Failure		400	{object}	contracts.ResponseOperator
@Failure		404	{object}	contracts.ResponseOperator
@Failure		500	{object}	contracts.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}	contracts.ResponseOperator
@Failure		400		{object}	contracts.ResponseOperator
@Failure		404		{object}	contracts.ResponseOperator
@Failure		500		{object}	contracts.ResponseOperator
@Router			/database/{key} [post]

func (*Api) SetupEncryptedDatabase

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

func (*Api) SetupKVStore added in v0.0.57

func (api *Api) SetupKVStore(TLSConfig *tls.Config, nodeID uint64, cluster []string)

func (*Api) StartCluster added in v0.0.57

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

func (*Api) Version added in v0.0.3

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

type Kv

type Kv struct {
	Value string
	Auth  string
}

Jump to

Keyboard shortcuts

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