Documentation ¶
Index ¶
- Constants
- func DecryptSymmetric(encdata, key []byte) ([]byte, error)
- func DeriveSymmetricKey(key string) ([]byte, error)
- func EncryptSymmetric(body, key []byte) ([]byte, error)
- func IsVersionLess(resp *VersionResponse) bool
- func IsVersionMin(resp *VersionResponse) bool
- func SanitizePostId(title string) string
- func ValidateCustomPostId(postId string) bool
- type AdminRequest
- type AdminResponse
- type AttachmentType
- type AuthTokens
- type BasicAuthCredentials
- type Blob
- type BlobBinaryAttachment
- type BlobHistoryItem
- type BlobList
- type BlobResponse
- type BlobSkeleton
- type ContentType
- type Post
- type PostResponse
- type UserResponse
- type VersionResponse
- type VisibilitySetting
- type VisibilityType
Constants ¶
View Source
const ( Attachment = "attachment" EncryptedAttachment = "encrypted_attachment" EncryptedBody = "encrypted_body" )
View Source
const ( ClientVersion = "0.3.3" ClientMinVersion = "0.3.0" ServerVersion = "0.3.2" )
View Source
const (
SaltString = "cbbc"
)
Variables ¶
This section is empty.
Functions ¶
func DecryptSymmetric ¶
func DeriveSymmetricKey ¶
func EncryptSymmetric ¶
func IsVersionLess ¶
func IsVersionLess(resp *VersionResponse) bool
func IsVersionMin ¶
func IsVersionMin(resp *VersionResponse) bool
func SanitizePostId ¶
func ValidateCustomPostId ¶
Types ¶
type AdminRequest ¶
type AdminRequest struct {
AdminPassword string `json:"admin_password"`
}
type AdminResponse ¶
type AdminResponse struct { NumUsers int `json:"num_users"` SomeUsers []UserResponse `json:"some_users"` }
type AttachmentType ¶
type AttachmentType string
type AuthTokens ¶
type BasicAuthCredentials ¶
type Blob ¶
type Blob struct { Id string `json:"id"` Title string `json:"title"` Type string `json:"type"` Data string `json:"data"` RawData []BlobBinaryAttachment `json:"raw_data"` Importance int `json:"importance"` Tags []string `json:"tags"` Deleted bool `json:"deleted"` ChildIds []string `json:"child_ids,omitempty"` Children []*Blob `json:"children,omitempty"` OwnerId string `json:"owner_id,omitempty"` ParentId string `json:"parent_id,omitempty"` ExpireTime *time.Time `json:"expire_time,omitempty"` VersionHistory []*BlobHistoryItem `json:"version_history,omitempty"` }
func (*Blob) EncryptedBody ¶
func (blob *Blob) EncryptedBody() *BlobBinaryAttachment
func (*Blob) IsEncryptedAndEmpty ¶
type BlobBinaryAttachment ¶
type BlobBinaryAttachment struct { Description string `json:"description"` Data []byte `json:"data"` Type AttachmentType `json:"type"` }
type BlobHistoryItem ¶
type BlobList ¶
type BlobList struct {
RootBlobs []*BlobSkeleton `json:"root_blobs"`
}
type BlobResponse ¶
type BlobResponse struct {
Blobs []*Blob `json:"blobs"`
}
type BlobSkeleton ¶
type BlobSkeleton struct { Id string `json:"id"` Title string `json:"title"` Type string `json:"type"` Importance int `json:"importance"` Tags []string `json:"tags"` Deleted bool `json:"deleted"` Children []*BlobSkeleton `json:"children,omitempty"` OwnerId string `json:"owner_id,omitempty"` ParentId string `json:"parent_id,omitempty"` }
type ContentType ¶
func ResolveContentType ¶
func ResolveContentType(userType string) *ContentType
type Post ¶
type Post struct { Id string `json:"post_id"` OwnerId string `json:"owner_id"` Visibility []VisibilitySetting `json:"visibility"` BlobId string `json:"blob_id"` PublicationId string `json:"publication_id"` }
func (*Post) HasPermission ¶
type PostResponse ¶
type PostResponse struct { Posts []*Post `json:"posts"` Blobs []*Blob `json:"blobs,omitempty"` Body string `json:"body,omitempty"` EncryptedBody []byte `json:"encrypted_body,omitempty"` }
func (*PostResponse) Render ¶
func (b *PostResponse) Render(w http.ResponseWriter, r *http.Request) error
type UserResponse ¶
type VersionResponse ¶
type VisibilitySetting ¶
type VisibilitySetting struct { Type VisibilityType `json:"type"` Audience string `json:"audience"` }
type VisibilityType ¶
type VisibilityType string
const ( Public VisibilityType = "public" SingleUser VisibilityType = "user" )
Click to show internal directories.
Click to hide internal directories.