client

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const API_VERSION = "v1"
View Source
const BASE_URI = "https://onetimesecret.com/api"
View Source
const HOST = "https://onetimesecret.com"

Variables

View Source
var ENDPOINTS = map[string]string{
	"status":      "status",
	"share":       "share",
	"generate":    "generate",
	"getsecret":   "secret",
	"getmetadata": "private",
	"burn":        "private",
	"getrecent":   "private",
}

Functions

func AgnosticRequest

func AgnosticRequest(a Auth, uri string, m string, b io.Reader) ([]byte, error)

func BurnSecret

func BurnSecret(a Auth, b SecretBody) bool

func CreateSecret

func CreateSecret(a Auth, b SecretBody, g bool)

func GetMetadata

func GetMetadata(a Auth, b SecretBody)

func GetRecent

func GetRecent(a Auth, b SecretBody)

func GetSecret

func GetSecret(a Auth, b SecretBody) bool

func GetStatus

func GetStatus(a Auth) bool

func Login

func Login(a Auth) bool

Types

type Auth

type Auth struct {
	Username string
	Password string
	Enabled  bool
}

type AuthYaml

type AuthYaml struct {
	Username string `yaml:"otsUser"`
	Password string `yaml:"otsToken"`
}

type BurnSecretResponse

type BurnSecretResponse struct {
	State Secret `json:"state"`
}
var BurnSecRes BurnSecretResponse

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}
var ErrResponse ErrorResponse

type History added in v1.1.0

type History []string

type Secret added in v1.1.0

type Secret struct {
	Custid             string   `json:"custid"`
	MetadataKey        string   `json:"metadata_key"`
	SecretKey          string   `json:"secret_key"`
	Ttl                int      `json:"ttl"`
	MetadataTtl        int      `json:"metadata_ttl"`
	SecretTtl          int      `json:"secret_ttl"`
	Recipient          []string `json:"recipient"`
	CreatedAt          int      `json:"created"`
	UpdatedAt          int      `json:"updated"`
	PassphraseRequired bool     `json:"passphrase_required"`
	Value              string   `json:"value"`
	ReceivedAt         int      `json:"received"`
	State              string   `json:"state"`
}

type SecretBody

type SecretBody struct {
	Secret     string
	Passphrase string
	Ttl        int
	Recipient  string
}

type Secrets

type Secrets []Secret

type StatusRes

type StatusRes struct {
	Status string `json:"status"`
}
var StsRes StatusRes

Jump to

Keyboard shortcuts

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