bongodb

package
v0.0.0-...-c05413c Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: GPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package bongodb contains BongoDB communication logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents client object with HTTP client and connection address.

func New

func New(address string) *Client

New creates new instance of client with given address.

func (*Client) Delete

func (c *Client) Delete(req *Request) *Response

Delete performs Delete BongoDB operation.

func (*Client) Get

func (c *Client) Get(req *Request) *Response

Get performs Get BongoDB operation.

func (*Client) Set

func (c *Client) Set(req *Request) *Response

Set performs Set BongoDB operation.

func (*Client) Truncate

func (c *Client) Truncate(req *Request) *Response

Truncate performs Truncate BongoDB operation.

type OperationType

type OperationType uint8

OperationType represents type of executed operation.

const (
	Set OperationType = iota
	Get
	Delete
	Truncate
)

type Request

type Request struct {
	OperationType OperationType `json:"operation_type"`
	Key           string        `json:"key"`
	Value         string        `json:"value"`
}

Request represents request object to BongoDB.

type Response

type Response struct {
	Error string `json:"error"`
	Value string `json:"value"`
}

Response represents response object from BongoDB.

Jump to

Keyboard shortcuts

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