privatebin

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

README

k6 privatebin performance test extension

This extension can be used to generate a privatebin encrypted paste.

build

to build k6 with this extension, type:

$ xk6 build v0.32.0 --with github.com/binxio/xk6-privatebin

run

to run a test with this extension, type:

$ ./k6 run -i 1 test.js

Documentation

Overview

Copyright 2021 - binx.io B.V.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomBytes

func GenerateRandomBytes(len int) (result []byte, err error)

Types

type PasteContent

type PasteContent struct {
	Paste string `json:"paste"`
}

type PasteData

type PasteData struct {
	*PasteSpec
	Data []byte
}

type PasteRequest

type PasteRequest struct {
	V     int              `json:"v"`
	AData []interface{}    `json:"adata"`
	Meta  PasteRequestMeta `json:"meta"`
	CT    string           `json:"ct"`
}

type PasteRequestMeta

type PasteRequestMeta struct {
	Expire string `json:"expire"`
}

type PasteResponse

type PasteResponse struct {
	Status      int    `json:"status"`
	ID          string `json:"id"`
	URL         string `json:"url"`
	DeleteToken string `json:"deletetoken"`
}

type PasteSpec

type PasteSpec struct {
	IV          string
	Salt        string
	Iterations  int
	KeySize     int
	TagSize     int
	Algorithm   string
	Mode        string
	Compression string
}

func (*PasteSpec) SpecArray

func (spec *PasteSpec) SpecArray() []interface{}

type PrivateBin

type PrivateBin struct{}

func (*PrivateBin) Encrypt

func (r *PrivateBin) Encrypt(payload string, expire string) (*Result, error)

func (*PrivateBin) EncryptRandomPayload added in v0.1.2

func (r *PrivateBin) EncryptRandomPayload(size int, expire string) (*Result, error)

type Result

type Result struct {
	Body string
	Key  string
}

Jump to

Keyboard shortcuts

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