Documentation
¶
Index ¶
- Constants
- func ConversationName(metadata *proto.ConversationMetadata) string
- func MessageName(date time.Time, sender string) string
- func ReadConversationMetadata(dir string) (*proto.ConversationMetadata, error)
- func UnmarshalFromFile(path string, out interface{ ... }) error
- type Message
- type Paths
- func (p *Paths) AccountPath() string
- func (p *Paths) AtomicWriteFile(path string, bs []byte, perm os.FileMode) error
- func (p *Paths) ConversationDir() string
- func (p *Paths) ConversationToOutbox(metadata *proto.ConversationMetadata, msgs ...string) error
- func (p *Paths) ListConversations() ([]*proto.ConversationMetadata, error)
- func (p *Paths) LoadMessages(conv *proto.ConversationMetadata) ([]*Message, error)
- func (p *Paths) MarshalToFile(path string, in interface{ ... }) error
- func (p *Paths) MessageToOutbox(conversationName, message string) error
- func (p *Paths) MkdirInTemp() (string, error)
- func (p *Paths) OutboxDir() string
- func (p *Paths) TempDir() string
- func (p *Paths) TempFile() (string, error)
Constants ¶
View Source
const ( MetadataFileName = "metadata.pb" AccountFileName = "account.pb" )
Variables ¶
This section is empty.
Functions ¶
func ConversationName ¶
func ConversationName(metadata *proto.ConversationMetadata) string
func ReadConversationMetadata ¶
func ReadConversationMetadata(dir string) (*proto.ConversationMetadata, error)
Types ¶
type Paths ¶
func (*Paths) AccountPath ¶
func (*Paths) AtomicWriteFile ¶
func (*Paths) ConversationDir ¶
func (*Paths) ConversationToOutbox ¶
func (p *Paths) ConversationToOutbox(metadata *proto.ConversationMetadata, msgs ...string) error
func (*Paths) ListConversations ¶
func (p *Paths) ListConversations() ([]*proto.ConversationMetadata, error)
func (*Paths) LoadMessages ¶
func (p *Paths) LoadMessages(conv *proto.ConversationMetadata) ([]*Message, error)
func (*Paths) MarshalToFile ¶
MarshalToFile atomically writes a Marshal()-able object to a file by first writing to a new file in tmpDir and then atomically renaming it to the destination file.
func (*Paths) MessageToOutbox ¶
func (*Paths) MkdirInTemp ¶
Click to show internal directories.
Click to hide internal directories.