store

package
v0.0.0-...-001db97 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbStore

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

func NewDbStore

func NewDbStore() *DbStore

func (*DbStore) CreateDdos

func (store *DbStore) CreateDdos(req DdosConfigReq) (*DdosConfig, error)

func (*DbStore) Delete

func (store *DbStore) Delete(uuid string) error

func (*DbStore) GetDdos

func (store *DbStore) GetDdos(uuid string) (*DdosConfig, error)

func (*DbStore) UpdateDdos

func (store *DbStore) UpdateDdos(req DdosConfigReq, uuid string) (*DdosConfig, error)

type DdosConfig

type DdosConfig struct {
	Uuid           string `db:"uuid,omitempty"`
	Url            string `db:"url"`
	NumberRequests int64  `db:"number_requests"`
	Duration       int64  `db:"duration" `
}

type DdosConfigReq

type DdosConfigReq struct {
	Url            string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	NumberRequests int64  `protobuf:"varint,2,opt,name=number_requests,json=number_requests,proto3" json:"number_requests,omitempty"`
	Duration       int64  `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"`
}

type Store

type Store interface {
	CreateDdos(DdosConfigReq) (*DdosConfig, error)
	GetDdos(string) (*DdosConfig, error)
	UpdateDdos(DdosConfigReq, string) (*DdosConfig, error)
	Delete(string) error
}

Jump to

Keyboard shortcuts

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