gjs

package
v1.10.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 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 ByRevision

type ByRevision []*Revision

ByRevision sorts to latest revision to the top, i.e. [0]

func (ByRevision) Len

func (r ByRevision) Len() int

func (ByRevision) Less

func (r ByRevision) Less(i, j int) bool

func (ByRevision) Swap

func (r ByRevision) Swap(i, j int)

type Entry

type Entry struct {
	Name      string      `json:"name"`
	Revisions []*Revision `json:"revisions"`
}

Entry is a key-value entry with a number of revisions

func (*Entry) Delete

func (e *Entry) Delete(msg string) bool

Delete marks an entry as deleted

func (*Entry) Equals

func (e *Entry) Equals(other *Entry) bool

Equals returns true if other is identical

func (*Entry) GetName

func (e *Entry) GetName() string

GetName returns the name

func (*Entry) GetRevisions

func (e *Entry) GetRevisions() []*Revision

GetRevisions returns the slice of revisions

func (*Entry) IsDeleted

func (e *Entry) IsDeleted() bool

IsDeleted returns true is an entry was marked as deleted

func (*Entry) Latest

func (e *Entry) Latest() *Revision

Latest returns the latest revision

func (*Entry) Merge

func (e *Entry) Merge(other *Entry) *Entry

Merge merges two entries

func (*Entry) SortedRevisions

func (e *Entry) SortedRevisions() []*Revision

SortedRevisions returns a list of sorted revisions

type Revision

type Revision struct {
	Created   *Timestamp `json:"created"`
	Message   string     `json:"message"`
	Filename  string     `json:"filename"`
	Tombstone bool       `json:"tombstone"`
}

Revision is a single revision of a secret

func (*Revision) Equals

func (r *Revision) Equals(other *Revision) bool

Equals returns true if other is the same

func (*Revision) GetCreated

func (r *Revision) GetCreated() *Timestamp

GetCreated returns the creation timestampo

func (*Revision) GetFilename

func (r *Revision) GetFilename() string

GetFilename returns the blob filename

func (*Revision) GetMessage

func (r *Revision) GetMessage() string

GetMessage returns the commit message

func (*Revision) GetTombstone

func (r *Revision) GetTombstone() bool

GetTombstone returns true if this entry was deleted. Important for merging.

func (*Revision) ID

func (r *Revision) ID() string

ID returns the unique ID of this entry TODO: It's not really unique. Need to fix that.

func (*Revision) Time

func (r *Revision) Time() time.Time

Time returns the time a revision was created

type Store

type Store struct {
	Name    string            `json:"name"`
	Entries map[string]*Entry `json:"entries"`
}

Store is secrets store

func (*Store) GetEntries

func (s *Store) GetEntries() map[string]*Entry

GetEntries returns the map of entries

func (*Store) GetName

func (s *Store) GetName() string

GetName returns the name

func (*Store) ListBlobs

func (s *Store) ListBlobs() []string

ListBlobs returns a slice of all contained blogs. For remote sync.

func (*Store) Merge

func (s *Store) Merge(other *Store) error

Merge merges two stores

type Timestamp

type Timestamp time.Time

Timestamp is time.Time with JSON encoding

func New

func New(t time.Time) *Timestamp

New returns a new timestamp

func Now

func Now() *Timestamp

Now returns time.Now() as a Timestamp

func (*Timestamp) MarshalJSON

func (t *Timestamp) MarshalJSON() ([]byte, error)

MarshalJSON implements the json marshaler

func (*Timestamp) Time

func (t *Timestamp) Time() time.Time

Time returns the underlying time.Time

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json unmarshaler

Jump to

Keyboard shortcuts

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