Documentation ¶
Overview ¶
* Copyright (c) 2014 Marco Peereboom <marco@peereboom.us> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Index ¶
- Constants
- Variables
- func GenerateCert(cert, key, id, name string, json []byte) error
- type Client
- type Confirmation
- type Core
- type Exit
- type MetaRecord
- type Rpc
- type RpcSendFile
- type SendFile
- type Server
- type Session
- func (s *Session) BecomeReady() (err error)
- func (s *Session) ConfirmationPhase(c *Confirmation) (err error)
- func (s *Session) DefaultSession(pid *mcrypt.PublicIdentity) (err error)
- func (s *Session) IdentityPhase(pid *mcrypt.PublicIdentity) (err error)
- func (s *Session) RpcReceive() (interface{}, error)
- func (s *Session) RpcSend(command interface{}) error
- func (s *Session) SendFile(sf *SendFile) error
- func (s *Session) SessionPhase() (err error)
- type Shutdown
- type Trust
- func (t *Trust) Add(id *mcrypt.Identity, trustee *mcrypt.PublicIdentity, state int, ...) error
- func (t *Trust) Close()
- func (t *Trust) Get(id *mcrypt.Identity, trustee *mcrypt.PublicIdentity) (*TrustRecord, error)
- func (t *Trust) GetAll(id *mcrypt.Identity) ([]*TrustRecord, error)
- func (t *Trust) Update(id *mcrypt.Identity, tr *TrustRecord) error
- type TrustRecord
- type UiConfirmIdentity
- type UiConfirmIdentityReply
- type UiConfirmPublicIdentity
- type UiConfirmPublicIdentityReply
- type UiPopup
- type UiReady
- type UiRenderIdentity
- type UiRenderTrust
- type UpdateTrustRecord
Constants ¶
const ( RpcIdentity = "identity" RpcConfirmation = "confirmation" RpcSendFileCommand = "sendfile" )
const ( StateInvalid = 0 StateQueued = 1 StateDenied = 2 StateAllowed = 100 )
const (
ProfilePicture = "ProfilePicture"
)
Variables ¶
var ( State = map[int]string{ StateInvalid: "Invalid", StateQueued: "Queued", StateDenied: "Denied", StateAllowed: "Allowed", } )
Functions ¶
func GenerateCert ¶
Types ¶
type Confirmation ¶
type Core ¶
func (*Core) NewClientSession ¶
establish a new session and return the session
func (*Core) ServerCallback ¶
type MetaRecord ¶
type MetaRecord struct { Version uint32 `json:"version"` Mime string `json:"mime"` Created time.Time `json:"created"` }
This structure is saved alongside content with some interesting information. this needs lots more stuff, like encrypt at rest, keys it was sent with etc TODO this probably deserves it's own package
type RpcSendFile ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) BecomeReady ¶
func (*Session) ConfirmationPhase ¶
func (s *Session) ConfirmationPhase(c *Confirmation) (err error)
func (*Session) DefaultSession ¶
func (s *Session) DefaultSession(pid *mcrypt.PublicIdentity) (err error)
func (*Session) IdentityPhase ¶
func (s *Session) IdentityPhase(pid *mcrypt.PublicIdentity) (err error)
func (*Session) RpcReceive ¶
func (*Session) SessionPhase ¶
type Trust ¶
type Trust struct {
// contains filtered or unexported fields
}
func (*Trust) Add ¶
func (t *Trust) Add(id *mcrypt.Identity, trustee *mcrypt.PublicIdentity, state int, freeToUse map[string]string, overwrite bool) error
Store public identity in database
func (*Trust) Get ¶
func (t *Trust) Get(id *mcrypt.Identity, trustee *mcrypt.PublicIdentity) (*TrustRecord, error)
Get public identity from database
type TrustRecord ¶
type UiConfirmIdentity ¶
signal UI to render dialog to confirm identity
type UiConfirmIdentityReply ¶
type UiConfirmIdentityReply struct { Name string Address string Identifiers []*mcrypt.Identifier Error error }
signal core that the UI has obtained an identity
type UiConfirmPublicIdentity ¶
type UiConfirmPublicIdentity struct {
PublicIdentity *mcrypt.PublicIdentity
}
signal UI to render dialog to confirm public identity
type UiConfirmPublicIdentityReply ¶
type UiConfirmPublicIdentityReply struct { PublicIdentity *mcrypt.PublicIdentity Error error State int }
signal core that the UI has done something with the public identity
type UiRenderIdentity ¶
type UiRenderIdentity struct {
PublicIdentity *mcrypt.PublicIdentity
}
signal UI to render identity
type UiRenderTrust ¶
type UiRenderTrust struct {
TrustRecords []*TrustRecord
}
signal UI to render identity
type UpdateTrustRecord ¶
type UpdateTrustRecord struct {
TrustRecord *TrustRecord
}
signal core to update trust record