secret

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package secret defines secret types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandID

func RandID() string

RandID creates a random secret ID.

Types

type Address

type Address struct {
	Address1   string `json:"address1,omitempty"`
	Address2   string `json:"address2,omitempty"`
	Address3   string `json:"address3,omitempty"`
	City       string `json:"city,omitempty"`  // Or Town
	State      string `json:"state,omitempty"` // Or Province
	PostalCode string `json:"zip,omitempty"`   // Or Postal Code
	Country    string `json:"country,omitempty"`
}

Address ...

type Card

type Card struct {
	FullName   string `json:"fullName,omitempty"`
	Number     string `json:"number,omitempty"`
	Expiration string `json:"expire,omitempty"`
	Code       string `json:"code,omitempty"`
}

Card ...

type Contact

type Contact struct {
	FirstName string    `json:"firstName,omitempty"`
	LastName  string    `json:"lastName,omitempty"`
	Company   string    `json:"company,omitempty"`
	Emails    []string  `json:"emails,omitempty"`
	Phones    []string  `json:"phones,omitempty"`
	Addresses []Address `json:"addresses,omitempty"`
}

Contact ...

type Secret

type Secret struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Type Type   `json:"type"`

	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`

	URL   string `json:"url,omitempty"`
	Notes string `json:"notes,omitempty"`

	Contact *Contact `json:"contact,omitempty"`
	Card    *Card    `json:"card,omitempty"`

	CreatedAt time.Time `json:"createdAt,omitempty"`
	UpdatedAt time.Time `json:"updatedAt,omitempty"`
}

Secret to keep.

func New

func New() *Secret

New creates a new Secret.

func NewPassword

func NewPassword(username string, password string, url string) *Secret

NewPassword creates a new password secret.

type Type

type Type string

Type for secret.

const (
	// UnknownType ...
	UnknownType Type = ""
	// PasswordType ...
	PasswordType Type = "password"
	// ContactType ...
	ContactType Type = "contact"
	// CardType ...
	CardType Type = "card"
	// NoteType ...
	NoteType Type = "note"
)

Jump to

Keyboard shortcuts

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