Documentation ¶
Index ¶
- type ErrIdExists
- type ErrIdNotExists
- type ErrInvalidID
- type ErrInvalidTagName
- type ErrNotOnionTree
- type ErrTagNotExists
- type OnionTree
- func (o OnionTree) AddService(s *Service) error
- func (o OnionTree) Dir() string
- func (o OnionTree) GetService(id string) (*Service, error)
- func (o OnionTree) GetServiceBytes(id string) ([]byte, error)
- func (o OnionTree) Init() error
- func (o OnionTree) ListServiceTags(id string) ([]Tag, error)
- func (o OnionTree) ListServices() ([]string, error)
- func (o OnionTree) ListServicesWithTag(tag Tag) ([]string, error)
- func (o OnionTree) ListTags() ([]Tag, error)
- func (o OnionTree) RemoveService(id string) error
- func (o OnionTree) TagService(id string, tags []Tag) error
- func (o OnionTree) TaggedDir() string
- func (o OnionTree) UnsortedDir() string
- func (o OnionTree) UntagService(id string, tags []Tag) error
- func (o OnionTree) UpdateService(s *Service) error
- type PublicKey
- type PublicKeys
- type Service
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrIdExists ¶
type ErrIdExists struct {
// contains filtered or unexported fields
}
func (*ErrIdExists) Error ¶
func (e *ErrIdExists) Error() string
type ErrIdNotExists ¶
type ErrIdNotExists struct {
// contains filtered or unexported fields
}
func (*ErrIdNotExists) Error ¶
func (e *ErrIdNotExists) Error() string
type ErrInvalidID ¶
type ErrInvalidID struct {
// contains filtered or unexported fields
}
func (*ErrInvalidID) Error ¶
func (e *ErrInvalidID) Error() string
type ErrInvalidTagName ¶
type ErrInvalidTagName struct {
// contains filtered or unexported fields
}
func (*ErrInvalidTagName) Error ¶
func (e *ErrInvalidTagName) Error() string
type ErrNotOnionTree ¶
type ErrNotOnionTree struct {
// contains filtered or unexported fields
}
func (*ErrNotOnionTree) Error ¶
func (e *ErrNotOnionTree) Error() string
type ErrTagNotExists ¶
type ErrTagNotExists struct {
// contains filtered or unexported fields
}
func (*ErrTagNotExists) Error ¶
func (e *ErrTagNotExists) Error() string
type OnionTree ¶
type OnionTree struct {
// contains filtered or unexported fields
}
func New ¶
New returns initialized OnionTree structure. The function does not check if `dir` is a valid OnionTree repository.
func Open ¶
Open attempts to "open" `dir` as a valid OnionTree repository. The function fails if the `dir` is not a valid OnionTree repository.
func (OnionTree) AddService ¶
Add adds a new service to the repository with data from `s`.
func (OnionTree) GetService ¶
GetService returns content of service `id`.
func (OnionTree) GetServiceBytes ¶
GetServiceBytes returns raw bytes of service `id`.
func (OnionTree) ListServiceTags ¶
ListServiceTags returns tags of service `id`. NOTICE: This function is very inefficient as it has to scale down the tagged directory recursively to find all symbolic links matching a pattern.
func (OnionTree) ListServices ¶
ListServices returns a list of service IDs found in the repository.
func (OnionTree) ListServicesWithTag ¶
ListServicesWithTag returns a list of services tagged with `tag`.
func (OnionTree) RemoveService ¶
Remove removes a service `id` from the repository with all its tags.
func (OnionTree) TagService ¶
TagService adds tags `tags` to service `id`.
func (OnionTree) UnsortedDir ¶
func (OnionTree) UntagService ¶
UntagService removes tags `tags` from service `id`.
func (OnionTree) UpdateService ¶
Update replaces existing service with new data from `s`.
type PublicKey ¶
type PublicKey struct { ID string `json:"id,omitempty" yaml:"id,omitempty"` UserID string `json:"user_id,omitempty" yaml:"user_id,omitempty"` Fingerprint string `json:"fingerprint,omitempty" yaml:"fingerprint,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` Value string `json:"value" yaml:"value"` }
func NewPublicKey ¶
type PublicKeys ¶
type PublicKeys []*PublicKey
The type implements openpgp.KeyRing interface.
func (PublicKeys) DecryptionKeys ¶
func (pks PublicKeys) DecryptionKeys() []openpgp.Key
DecryptionKeys returns all private keys that are valid for decryption.
func (PublicKeys) KeysById ¶
func (pks PublicKeys) KeysById(id uint64) []openpgp.Key
KeysById returns the set of keys that have the given key id.
func (PublicKeys) KeysByIdUsage ¶
func (pks PublicKeys) KeysByIdUsage(id uint64, requiredUsage byte) []openpgp.Key
KeysByIdAndUsage returns the set of keys with the given id that also meet the key usage given by requiredUsage. The requiredUsage is expressed as the bitwise-OR of packet.KeyFlag* values.
type Service ¶
type Service struct { Name string `json:"name" yaml:"name"` Description string `json:"description,omitempty" yaml:"description,omitempty"` URLs []string `json:"urls" yaml:"urls"` PublicKeys PublicKeys `json:"public_keys,omitempty" yaml:"public_keys,omitempty"` // contains filtered or unexported fields }