Documentation ¶
Overview ¶
@host localhost:5300 @BasePath /v1 @schemes http
@securityDefinitions.apikey ApiKeyAuth @in header @name Authorization
Index ¶
- Constants
- Variables
- func GenerateReference(e EntityType) string
- func HashPassword(p string) (string, error)
- func IsDuplicateUniqueError(e error) bool
- func IsImageFromURL(s string) (bool, error)
- func VerifyPassword(hashed, plain string) bool
- type BillingPreferences
- type Block
- type BlockContents
- type BulletListItemBlock
- type CommunicationPreferences
- type Contact
- type ContactList
- type ContactListMapping
- type ContactListMappingWithContact
- type ContactListOptions
- type ContactListRepository
- type ContactRepository
- type ContactShare
- type ContactShareItem
- type ContactShareItemType
- type ContactShareRepository
- type ContactTitle
- type Counter
- type CreateDeckOptions
- type CreateUpdateOptions
- type CreateWorkspaceOptions
- type CustomContactMetadata
- type Dashboard
- type Deck
- type DeckPreference
- type DeckRepository
- type DefaultProps
- type Email
- type EntityType
- type FetchContactListOptions
- type FetchContactOptions
- type FetchDeckOptions
- type FetchPlanOptions
- type FetchUpdateOptions
- type FindUserOptions
- type FindWorkspaceOptions
- type HeadingBlock
- type ImageBlock
- type InlineContent
- type Integration
- type IntegrationMetadata
- type IntegrationProvider
- type IntegrationRepository
- type IntegrationType
- type Link
- type ListContactOptions
- type ListUpdateFilterStatus
- type ListUpdateOptions
- type MalakError
- type NumberedListItemBlock
- type PaginatedResultMetadata
- type Paginator
- type ParagraphBlock
- type Password
- type PasswordDeckPreferences
- type Plan
- type PlanMetadata
- type PlanRepository
- type Preference
- type PreferenceRepository
- type ReactionStatus
- type RecipientStatus
- type RecipientType
- type Reference
- type ReferenceGenerator
- type ReferenceGeneratorOperation
- type Role
- type StyledText
- type Styles
- type TableBlock
- type TableContent
- type Update
- type UpdateContent
- type UpdateLink
- type UpdateMetadata
- type UpdateRecipient
- type UpdateRecipientLog
- type UpdateRecipientLogProvider
- type UpdateRecipientStat
- type UpdateRepository
- type UpdateSchedule
- type UpdateSendSchedule
- type UpdateStat
- type UpdateStatus
- type UpdateType
- type User
- type UserMetadata
- type UserRepository
- type UserRole
- type UserRoles
- type UuidGenerator
- type Workspace
- type WorkspaceIntegration
- type WorkspaceIntegrationMetadata
- type WorkspaceMetadata
- type WorkspaceRepository
Constants ¶
const ( ErrContactNotFound = MalakError("contact not found") ErrContactExists = MalakError("contact with email already exists") )
const ( ErrUpdateNotFound = MalakError("update not exists") ErrUpdateRecipientCapacityExceeded = MalakError("you have reached the max number of recipients per update") ErrPinnedUpdateNotExists = MalakError("update not pinned") ErrPinnedUpdateCapacityExceeded = MalakError( `you have exceeded the maximum number of pinned updates. Please unpin an update and pin this again`) ErrPinnedDeckCapacityExceeded = MalakError( `you have exceeded the maximum number of pinned updates. Please unpin an update and pin this again`) ErrUpdateScheduleNotFound = MalakError("update schedule not found") MaximumNumberOfPinnedUpdates = 4 )
const ( ErrUserNotFound = MalakError("user not found") ErrUserExists = MalakError("User with email already exists") )
const (
ErrDeckNotFound = MalakError("deck not found")
)
Variables ¶
var ( ErrPlanNotFound = MalakError("plan does not exists") ErrCounterExhausted = MalakError("no more units left") ErrOnlyOneDefaultPlan = MalakError("there can only be one default plan") )
var (
ErrContactListNotFound = MalakError("contact list not found")
)
var ErrInvalidContactTitle = errors.New("not a valid ContactTitle")
var ErrInvalidEntityType = errors.New("not a valid EntityType")
var ErrInvalidIntegrationType = errors.New("not a valid IntegrationType")
var ErrInvalidListUpdateFilterStatus = errors.New("not a valid ListUpdateFilterStatus")
var ErrInvalidReactionStatus = errors.New("not a valid ReactionStatus")
var ErrInvalidRecipientStatus = errors.New("not a valid RecipientStatus")
var ErrInvalidRecipientType = errors.New("not a valid RecipientType")
var ErrInvalidRole = errors.New("not a valid Role")
var ErrInvalidUpdateRecipientLogProvider = errors.New("not a valid UpdateRecipientLogProvider")
var ErrInvalidUpdateSendSchedule = errors.New("not a valid UpdateSendSchedule")
var ErrInvalidUpdateStatus = errors.New("not a valid UpdateStatus")
var ErrInvalidUpdateType = errors.New("not a valid UpdateType")
var (
ErrWorkspaceNotFound = MalakError("workspace not found")
)
Functions ¶
func HashPassword ¶
func IsDuplicateUniqueError ¶
func IsImageFromURL ¶ added in v0.3.1
func VerifyPassword ¶
Types ¶
type BillingPreferences ¶ added in v0.3.1
type BillingPreferences struct {
FinanceEmail Email `json:"finance_email,omitempty"`
}
type BlockContents ¶
type BlockContents []Block
func SanitizeBlocks ¶
func SanitizeBlocks(blocks BlockContents) (BlockContents, error)
func (BlockContents) HTML ¶
func (bc BlockContents) HTML() string
type BulletListItemBlock ¶
type BulletListItemBlock struct { Block Content []InlineContent `json:"content"` }
type CommunicationPreferences ¶ added in v0.3.1
type Contact ¶
type Contact struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` Email Email `json:"email,omitempty"` WorkspaceID uuid.UUID `json:"workspace_id,omitempty"` Reference Reference `json:"reference,omitempty"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Company string `json:"company,omitempty"` City string `json:"city,omitempty"` Phone string `json:"phone,omitempty"` Notes string `json:"notes,omitempty"` Lists []ContactListMapping `json:"lists" bun:"rel:has-many,join:id=contact_id"` // User who owns the contact. // Does not mean who added the contact but who chases // or follows up officially with the contact OwnerID uuid.UUID `json:"owner_id,omitempty"` // User who added/created this contact CreatedBy uuid.UUID `json:"created_by,omitempty"` Metadata CustomContactMetadata `json:"metadata,omitempty"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty"` bun.BaseModel `json:"-"` }
type ContactList ¶
type ContactList struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` Title string `json:"title,omitempty"` WorkspaceID uuid.UUID `json:"workspace_id,omitempty"` Reference Reference `json:"reference,omitempty"` CreatedBy uuid.UUID `json:"created_by,omitempty"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty"` bun.BaseModel `json:"-"` }
type ContactListMapping ¶
type ContactListMapping struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` ContactID uuid.UUID `json:"contact_id,omitempty"` ListID uuid.UUID `json:"list_id,omitempty"` List *ContactList `json:"list,omitempty" bun:"rel:has-one,join:list_id=id"` Reference Reference `json:"reference,omitempty"` CreatedBy uuid.UUID `json:"created_by,omitempty"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty"` bun.BaseModel `json:"-"` }
type ContactListOptions ¶
type ContactListRepository ¶
type ContactListRepository interface { Create(context.Context, *ContactList) error Get(context.Context, FetchContactListOptions) (*ContactList, error) Delete(context.Context, *ContactList) error Update(context.Context, *ContactList) error Add(context.Context, *ContactListMapping) error List(context.Context, *ContactListOptions) ([]ContactList, []ContactListMappingWithContact, error) }
type ContactRepository ¶
type ContactShare ¶ added in v0.3.0
type ContactShare struct {}
type ContactShareItem ¶ added in v0.3.0
type ContactShareItem struct {}
type ContactShareItemType ¶ added in v0.3.0
type ContactShareItemType string
ENUM(update,dashboard,deck)
const ( ContactShareItemType = "update" ContactShareItemTypeDashboard ContactShareItemType = "dashboard" ContactShareItemTypeDeck ContactShareItemType = "deck" )ContactShareItemTypeUpdate
func ParseContactShareItemType ¶ added in v0.3.0
func ParseContactShareItemType(name string) (ContactShareItemType, error)
ParseContactShareItemType attempts to convert a string to a ContactShareItemType.
func (ContactShareItemType) IsValid ¶ added in v0.3.0
func (x ContactShareItemType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (ContactShareItemType) String ¶ added in v0.3.0
func (x ContactShareItemType) String() string
String implements the Stringer interface.
type ContactShareRepository ¶ added in v0.3.0
type ContactShareRepository interface {
}type ContactTitle ¶
type ContactTitle string
ENUM(mr,mrs,miss,doctor,chief)
const ( // ContactTitleMr is a ContactTitle of type mr. ContactTitleMr ContactTitle = "mr" // ContactTitleMrs is a ContactTitle of type mrs. ContactTitleMrs ContactTitle = "mrs" // ContactTitleMiss is a ContactTitle of type miss. ContactTitleMiss ContactTitle = "miss" // ContactTitleDoctor is a ContactTitle of type doctor. ContactTitleDoctor ContactTitle = "doctor" // ContactTitleChief is a ContactTitle of type chief. ContactTitleChief ContactTitle = "chief" )
func ParseContactTitle ¶
func ParseContactTitle(name string) (ContactTitle, error)
ParseContactTitle attempts to convert a string to a ContactTitle.
func (ContactTitle) IsValid ¶
func (x ContactTitle) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (ContactTitle) String ¶
func (x ContactTitle) String() string
String implements the Stringer interface.
type CreateDeckOptions ¶
type CreateDeckOptions struct { RequireEmail bool `json:"require_email,omitempty"` EnableDownloading bool `json:"enable_downloading,omitempty"` Password struct { Enabled bool `json:"enabled,omitempty" validate:"required"` Password Password `json:"password,omitempty" validate:"required"` } `json:"password,omitempty" validate:"required"` ExpiresAt *time.Time `json:"expires_at,omitempty"` Reference Reference `json:"reference,omitempty"` }
type CreateUpdateOptions ¶
type CreateUpdateOptions struct { Reference func(EntityType) string Generator ReferenceGeneratorOperation Email Email WorkspaceID uuid.UUID Emails []Email Schedule *UpdateSchedule UserID uuid.UUID UpdateReference Reference Plan *Plan }
type CreateWorkspaceOptions ¶
type CustomContactMetadata ¶
type Deck ¶
type Deck struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` Reference Reference `json:"reference,omitempty"` WorkspaceID uuid.UUID `json:"workspace_id,omitempty"` CreatedBy uuid.UUID `json:"created_by,omitempty"` Title string `json:"title,omitempty"` ShortLink string `json:"short_link,omitempty"` DeckSize int64 `json:"deck_size,omitempty"` IsArchived bool `json:"is_archived,omitempty"` IsPinned bool `json:"is_pinned,omitempty"` ObjectKey string `json:"object_key,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty"` DeckPreference *DeckPreference `bun:"rel:has-one,join:id=deck_id" json:"preferences,omitempty"` bun.BaseModel `bun:"table:decks" json:"-"` }
type DeckPreference ¶
type DeckPreference struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` Reference Reference `json:"reference,omitempty"` WorkspaceID uuid.UUID `json:"workspace_id,omitempty"` DeckID uuid.UUID `json:"deck_id,omitempty"` EnableDownloading bool `json:"enable_downloading,omitempty"` RequireEmail bool `json:"require_email,omitempty"` Password PasswordDeckPreferences `json:"password,omitempty"` ExpiresAt *time.Time `bun:",soft_delete,nullzero" json:"expires_at,omitempty"` CreatedBy uuid.UUID `json:"created_by,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty"` bun.BaseModel `json:"-"` }
type DeckRepository ¶
type DeckRepository interface { Create(context.Context, *Deck, *CreateDeckOptions) error List(context.Context, *Workspace) ([]Deck, error) Get(context.Context, FetchDeckOptions) (*Deck, error) Delete(context.Context, *Deck) error UpdatePreferences(context.Context, *Deck) error ToggleArchive(context.Context, *Deck) error TogglePinned(context.Context, *Deck) error }
type DefaultProps ¶
type EntityType ¶
type EntityType string
ENUM( workspace,invoice, team,invite,contact, update,link,room, recipient,schedule,list, list_email, update_stat, recipient_stat,recipient_log, deck,deck_preference, contact_share,dashboard, plan,price,integration,workspace_integration)
const ( // EntityTypeWorkspace is a EntityType of type workspace. EntityTypeWorkspace EntityType = "workspace" // EntityTypeInvoice is a EntityType of type invoice. EntityTypeInvoice EntityType = "invoice" // EntityTypeTeam is a EntityType of type team. EntityTypeTeam EntityType = "team" // EntityTypeInvite is a EntityType of type invite. EntityTypeInvite EntityType = "invite" // EntityTypeContact is a EntityType of type contact. EntityTypeContact EntityType = "contact" // EntityTypeUpdate is a EntityType of type update. EntityTypeUpdate EntityType = "update" // EntityTypeLink is a EntityType of type link. EntityTypeLink EntityType = "link" // EntityTypeRoom is a EntityType of type room. EntityTypeRoom EntityType = "room" // EntityTypeRecipient is a EntityType of type recipient. EntityTypeRecipient EntityType = "recipient" // EntityTypeSchedule is a EntityType of type schedule. EntityTypeSchedule EntityType = "schedule" // EntityTypeList is a EntityType of type list. EntityTypeList EntityType = "list" // EntityTypeListEmail is a EntityType of type list_email. EntityTypeListEmail EntityType = "list_email" // EntityTypeUpdateStat is a EntityType of type update_stat. EntityTypeUpdateStat EntityType = "update_stat" // EntityTypeRecipientStat is a EntityType of type recipient_stat. EntityTypeRecipientStat EntityType = "recipient_stat" // EntityTypeRecipientLog is a EntityType of type recipient_log. EntityTypeRecipientLog EntityType = "recipient_log" // EntityTypeDeck is a EntityType of type deck. EntityTypeDeck EntityType = "deck" // EntityTypeDeckPreference is a EntityType of type deck_preference. EntityTypeDeckPreference EntityType = "deck_preference" EntityTypeContactShare EntityType = "contact_share" // EntityTypeDashboard is a EntityType of type dashboard. EntityTypeDashboard EntityType = "dashboard" // EntityTypePlan is a EntityType of type plan. EntityTypePlan EntityType = "plan" // EntityTypePrice is a EntityType of type price. EntityTypePrice EntityType = "price" // EntityTypeIntegration is a EntityType of type integration. EntityTypeIntegration EntityType = "integration" // EntityTypeWorkspaceIntegration is a EntityType of type workspace_integration. EntityTypeWorkspaceIntegration EntityType = "workspace_integration" )
func ParseEntityType ¶
func ParseEntityType(name string) (EntityType, error)
ParseEntityType attempts to convert a string to a EntityType.
func (EntityType) IsValid ¶
func (x EntityType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (EntityType) String ¶
func (x EntityType) String() string
String implements the Stringer interface.
type FetchContactListOptions ¶
type FetchContactOptions ¶
type FetchDeckOptions ¶
type FetchPlanOptions ¶
type FetchUpdateOptions ¶
type FindUserOptions ¶
type FindWorkspaceOptions ¶
type HeadingBlock ¶
type HeadingBlock struct { Block Props struct { DefaultProps Level int `json:"level"` } `json:"props"` Content []InlineContent `json:"content"` }
type ImageBlock ¶
type ImageBlock struct { Block Props struct { DefaultProps URL string `json:"url"` Caption string `json:"caption"` PreviewWidth int `json:"previewWidth"` } `json:"props"` }
type InlineContent ¶
type InlineContent interface {
// contains filtered or unexported methods
}
type Integration ¶ added in v0.3.1
type Integration struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` IntegrationName string `json:"integration_name,omitempty"` Reference Reference `json:"reference,omitempty"` Description string `json:"description,omitempty"` IsEnabled bool `json:"is_enabled,omitempty"` IntegrationType IntegrationType `json:"integration_type,omitempty"` LogoURL string `json:"logo_url,omitempty"` Metadata IntegrationMetadata `json:"metadata,omitempty" bson:"metadata"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty" bson:"created_at"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty" bson:"updated_at"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty" bson:"deleted_at"` bun.BaseModel `json:"-"` }
type IntegrationMetadata ¶ added in v0.3.1
type IntegrationMetadata struct {
Endpoint string `json:"endpoint,omitempty"`
}
type IntegrationProvider ¶ added in v0.3.1
type IntegrationRepository ¶ added in v0.3.1
type IntegrationRepository interface { Create(context.Context, *Integration) error List(context.Context, *Workspace) ([]WorkspaceIntegration, error) }
type IntegrationType ¶ added in v0.3.1
type IntegrationType string
ENUM(oauth2,api_key)
const ( // IntegrationTypeOauth2 is a IntegrationType of type oauth2. IntegrationTypeOauth2 IntegrationType = "oauth2" // IntegrationTypeApiKey is a IntegrationType of type api_key. IntegrationTypeApiKey IntegrationType = "api_key" )
func ParseIntegrationType ¶ added in v0.3.1
func ParseIntegrationType(name string) (IntegrationType, error)
ParseIntegrationType attempts to convert a string to a IntegrationType.
func (IntegrationType) IsValid ¶ added in v0.3.1
func (x IntegrationType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (IntegrationType) String ¶ added in v0.3.1
func (x IntegrationType) String() string
String implements the Stringer interface.
type Link ¶
type Link struct { Type string `json:"type"` Content []StyledText `json:"content"` Href string `json:"href"` }
type ListContactOptions ¶
type ListContactOptions struct { Paginator Paginator WorkspaceID uuid.UUID Status ListUpdateFilterStatus }
type ListUpdateFilterStatus ¶
type ListUpdateFilterStatus string
ENUM(draft,sent,all)
const ( // ListUpdateFilterStatusDraft is a ListUpdateFilterStatus of type draft. ListUpdateFilterStatusDraft ListUpdateFilterStatus = "draft" // ListUpdateFilterStatusSent is a ListUpdateFilterStatus of type sent. ListUpdateFilterStatusSent ListUpdateFilterStatus = "sent" // ListUpdateFilterStatusAll is a ListUpdateFilterStatus of type all. ListUpdateFilterStatusAll ListUpdateFilterStatus = "all" )
func ParseListUpdateFilterStatus ¶
func ParseListUpdateFilterStatus(name string) (ListUpdateFilterStatus, error)
ParseListUpdateFilterStatus attempts to convert a string to a ListUpdateFilterStatus.
func (ListUpdateFilterStatus) IsValid ¶
func (x ListUpdateFilterStatus) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (ListUpdateFilterStatus) String ¶
func (x ListUpdateFilterStatus) String() string
String implements the Stringer interface.
type ListUpdateOptions ¶
type ListUpdateOptions struct { Paginator Paginator WorkspaceID uuid.UUID Status ListUpdateFilterStatus }
type MalakError ¶
type MalakError string
func (MalakError) Error ¶
func (m MalakError) Error() string
type NumberedListItemBlock ¶
type NumberedListItemBlock struct { Block Content []InlineContent `json:"content"` }
type PaginatedResultMetadata ¶
type PaginatedResultMetadata struct {
Total int64
}
type ParagraphBlock ¶
type ParagraphBlock struct { Block Content []InlineContent `json:"content"` }
type PasswordDeckPreferences ¶
type Plan ¶
type Plan struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` PlanName string `json:"plan_name,omitempty"` // Can use a fake id really // As this only matters if you turn on Stripe Reference string `json:"reference,omitempty"` Metadata PlanMetadata `json:"metadata,omitempty" bson:"metadata"` // Stripe default price id. Again not needed if not using Stripe DefaultPriceID string `json:"default_price_id,omitempty"` // Defaults to zero Amount int64 `json:"amount,omitempty"` // IsDefault if this is the default plan for the user to get signed up to // on sign up // // Better to keep this here than to use config IsDefault bool `json:"is_default,omitempty"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty" bson:"created_at"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty" bson:"updated_at"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty" bson:"deleted_at"` bun.BaseModel `json:"-"` }
type PlanMetadata ¶
type PlanMetadata struct { Team struct { Size Counter `json:"size,omitempty"` } `json:"team,omitempty"` Deck struct { AutoTerminateLink bool `json:"auto_terminate_link,omitempty"` CustomDomain bool `json:"custom_domain,omitempty"` } `json:"deck,omitempty"` Updates struct { MaxRecipients Counter `json:"max_recipients,omitempty"` CustomDomain bool `json:"custom_domain,omitempty"` } `json:"updates,omitempty"` Integrations struct { AvailableForUse Counter `json:"available_for_use,omitempty"` } `json:"integrations,omitempty"` Dashboard struct { ShareDashboardViaLink bool `json:"share_dashboard_via_link,omitempty"` EmbedDashboard bool `json:"embed_dashboard,omitempty"` } `json:"dashboard,omitempty"` DataRoom struct { Size Counter `json:"size,omitempty"` ShareViaLink bool `json:"share_via_link,omitempty"` } `json:"data_room,omitempty"` }
type PlanRepository ¶
type Preference ¶ added in v0.3.1
type Preference struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` WorkspaceID uuid.UUID `json:"workspace_id,omitempty"` Communication CommunicationPreferences `json:"communication,omitempty"` Billing BillingPreferences `json:"billing,omitempty"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty" bson:"created_at"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty" bson:"updated_at"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty" bson:"deleted_at"` bun.BaseModel `json:"-"` }
func NewPreference ¶ added in v0.3.1
func NewPreference(workspace *Workspace) *Preference
type PreferenceRepository ¶ added in v0.3.1
type PreferenceRepository interface { Get(context.Context, *Workspace) (*Preference, error) Update(context.Context, *Preference) error }
type ReactionStatus ¶
type ReactionStatus string
ENUM(thumbs up,thumbs down)
const ( // ReactionStatusThumbsUp is a ReactionStatus of type thumbs up. ReactionStatusThumbsUp ReactionStatus = "thumbs up" // ReactionStatusThumbsDown is a ReactionStatus of type thumbs down. ReactionStatusThumbsDown ReactionStatus = "thumbs down" )
func ParseReactionStatus ¶
func ParseReactionStatus(name string) (ReactionStatus, error)
ParseReactionStatus attempts to convert a string to a ReactionStatus.
func (ReactionStatus) IsValid ¶
func (x ReactionStatus) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (ReactionStatus) String ¶
func (x ReactionStatus) String() string
String implements the Stringer interface.
type RecipientStatus ¶
type RecipientStatus string
ENUM(pending,sent,failed)
const ( // RecipientStatusPending is a RecipientStatus of type pending. RecipientStatusPending RecipientStatus = "pending" // RecipientStatusSent is a RecipientStatus of type sent. RecipientStatusSent RecipientStatus = "sent" // RecipientStatusFailed is a RecipientStatus of type failed. RecipientStatusFailed RecipientStatus = "failed" )
func ParseRecipientStatus ¶
func ParseRecipientStatus(name string) (RecipientStatus, error)
ParseRecipientStatus attempts to convert a string to a RecipientStatus.
func (RecipientStatus) IsValid ¶
func (x RecipientStatus) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (RecipientStatus) String ¶
func (x RecipientStatus) String() string
String implements the Stringer interface.
type RecipientType ¶
type RecipientType string
ENUM(list,email) List is a flattened group that can contain infinite amount of emails
const ( // RecipientTypeList is a RecipientType of type list. RecipientTypeList RecipientType = "list" // RecipientTypeEmail is a RecipientType of type email. RecipientTypeEmail RecipientType = "email" )
func ParseRecipientType ¶
func ParseRecipientType(name string) (RecipientType, error)
ParseRecipientType attempts to convert a string to a RecipientType.
func (RecipientType) IsValid ¶
func (x RecipientType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (RecipientType) String ¶
func (x RecipientType) String() string
String implements the Stringer interface.
type ReferenceGenerator ¶
type ReferenceGenerator struct{}
func NewReferenceGenerator ¶
func NewReferenceGenerator() *ReferenceGenerator
func (*ReferenceGenerator) Generate ¶
func (r *ReferenceGenerator) Generate(e EntityType) Reference
func (*ReferenceGenerator) ShortLink ¶
func (r *ReferenceGenerator) ShortLink() string
type ReferenceGeneratorOperation ¶
type ReferenceGeneratorOperation interface { Generate(EntityType) Reference ShortLink() string }
type Role ¶
type Role string
ENUM(admin,member,billing,investor,guest)
const ( // RoleAdmin is a Role of type admin. RoleAdmin Role = "admin" // RoleMember is a Role of type member. RoleMember Role = "member" // RoleBilling is a Role of type billing. RoleBilling Role = "billing" // RoleInvestor is a Role of type investor. RoleInvestor Role = "investor" // RoleGuest is a Role of type guest. RoleGuest Role = "guest" )
type StyledText ¶
type TableBlock ¶
type TableBlock struct { Block Content TableContent `json:"content"` }
type TableContent ¶
type TableContent struct { Type string `json:"type"` Rows []struct { Cells [][]InlineContent `json:"cells"` } `json:"rows"` }
type Update ¶
type Update struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` WorkspaceID uuid.UUID `json:"workspace_id,omitempty"` Status UpdateStatus `json:"status,omitempty"` Reference Reference `json:"reference,omitempty"` CreatedBy uuid.UUID `json:"created_by,omitempty"` SentBy uuid.UUID `json:"sent_by,omitempty" bun:",nullzero"` Content BlockContents `json:"content,omitempty"` // If this update is pinned IsPinned bool `json:"is_pinned,omitempty"` Title string `json:"title,omitempty"` Metadata UpdateMetadata `json:"metadata,omitempty"` SentAt *time.Time `bun:",nullzero" json:"sent_at,omitempty"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty"` bun.BaseModel `json:"-"` }
type UpdateContent ¶
type UpdateContent string
type UpdateLink ¶
type UpdateLink struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` Reference Reference `json:"reference,omitempty"` UpdateID uuid.UUID `json:"update_id,omitempty"` // Sometimes, you want to share a link containing a specific update // for a few minutes or seconds :) ExpiresAt *time.Time `json:"expires_at,omitempty" bun:",nullzero,notnull,default:current_timestamp"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at" ` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at" ` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty"` bun.BaseModel `json:"-"` }
type UpdateMetadata ¶
type UpdateMetadata struct { }
type UpdateRecipient ¶
type UpdateRecipient struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` Reference Reference `json:"reference,omitempty"` UpdateID uuid.UUID `json:"update_id,omitempty"` ContactID uuid.UUID `json:"contact_id,omitempty"` ScheduleID uuid.UUID `json:"schedule_id,omitempty"` Status RecipientStatus `json:"status,omitempty"` UpdateRecipientStat *UpdateRecipientStat `json:"update_recipient_stat,omitempty" bun:"rel:has-one,join:id=recipient_id"` Contact *Contact `json:"contact,omitempty" bun:"rel:has-one,join:contact_id=id"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty"` bun.BaseModel `json:"-"` }
type UpdateRecipientLog ¶
type UpdateRecipientLog struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` Reference Reference `json:"reference,omitempty"` RecipientID uuid.UUID `json:"recipient_id,omitempty"` ProviderID string `json:"provider_id,omitempty"` Provider UpdateRecipientLogProvider `json:"provider,omitempty"` Recipient *UpdateRecipient `json:"recipient" bun:"rel:has-one,join:recipient_id=id"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty"` bun.BaseModel `json:"-"` }
type UpdateRecipientLogProvider ¶
type UpdateRecipientLogProvider string
ENUM(resend,sendgrid,smtp)
const ( // UpdateRecipientLogProviderResend is a UpdateRecipientLogProvider of type resend. UpdateRecipientLogProviderResend UpdateRecipientLogProvider = "resend" // UpdateRecipientLogProviderSendgrid is a UpdateRecipientLogProvider of type sendgrid. UpdateRecipientLogProviderSendgrid UpdateRecipientLogProvider = "sendgrid" // UpdateRecipientLogProviderSmtp is a UpdateRecipientLogProvider of type smtp. UpdateRecipientLogProviderSmtp UpdateRecipientLogProvider = "smtp" )
func ParseUpdateRecipientLogProvider ¶
func ParseUpdateRecipientLogProvider(name string) (UpdateRecipientLogProvider, error)
ParseUpdateRecipientLogProvider attempts to convert a string to a UpdateRecipientLogProvider.
func (UpdateRecipientLogProvider) IsValid ¶
func (x UpdateRecipientLogProvider) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (UpdateRecipientLogProvider) String ¶
func (x UpdateRecipientLogProvider) String() string
String implements the Stringer interface.
type UpdateRecipientStat ¶
type UpdateRecipientStat struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` Reference Reference `json:"reference,omitempty"` RecipientID uuid.UUID `json:"recipient_id,omitempty"` Recipient *UpdateRecipient `json:"recipient" bun:"rel:has-one,join:recipient_id=id"` LastOpenedAt *time.Time `bun:",soft_delete,nullzero" json:"last_opened_at,omitempty"` HasReaction bool `json:"has_reaction,omitempty"` IsDelivered bool `json:"is_delivered,omitempty"` IsBounced bool `json:"is_bounced,omitempty"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty"` bun.BaseModel `json:"-"` }
type UpdateRepository ¶
type UpdateRepository interface { Create(context.Context, *Update) error Update(context.Context, *Update) error Get(context.Context, FetchUpdateOptions) (*Update, error) GetByID(context.Context, uuid.UUID) (*Update, error) List(context.Context, ListUpdateOptions) ([]Update, int64, error) ListPinned(context.Context, uuid.UUID) ([]Update, error) Delete(context.Context, *Update) error TogglePinned(context.Context, *Update) error GetSchedule(context.Context, uuid.UUID) (*UpdateSchedule, error) SendUpdate(context.Context, *CreateUpdateOptions) error GetStatByEmailID(context.Context, string, UpdateRecipientLogProvider) (*UpdateRecipientLog, *UpdateRecipientStat, error) Stat(context.Context, *Update) (*UpdateStat, error) UpdateStat(context.Context, *UpdateStat, *UpdateRecipientStat) error RecipientStat(context.Context, *Update) ([]UpdateRecipient, error) }
type UpdateSchedule ¶
type UpdateSchedule struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` Reference Reference `json:"reference,omitempty"` UpdateID uuid.UUID `json:"update_id,omitempty"` ScheduledBy uuid.UUID `json:"scheduled_by,omitempty"` Status UpdateSendSchedule `json:"status,omitempty"` UpdateType UpdateType `json:"update_type,omitempty"` // Time to send this update at? SendAt time.Time `json:"send_at,omitempty"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty"` bun.BaseModel `json:"-"` }
type UpdateSendSchedule ¶
type UpdateSendSchedule string
ENUM(scheduled,cancelled,sent,failed,processing)
const ( // UpdateSendScheduleScheduled is a UpdateSendSchedule of type scheduled. UpdateSendScheduleScheduled UpdateSendSchedule = "scheduled" // UpdateSendScheduleCancelled is a UpdateSendSchedule of type cancelled. UpdateSendScheduleCancelled UpdateSendSchedule = "cancelled" // UpdateSendScheduleSent is a UpdateSendSchedule of type sent. UpdateSendScheduleSent UpdateSendSchedule = "sent" // UpdateSendScheduleFailed is a UpdateSendSchedule of type failed. UpdateSendScheduleFailed UpdateSendSchedule = "failed" // UpdateSendScheduleProcessing is a UpdateSendSchedule of type processing. UpdateSendScheduleProcessing UpdateSendSchedule = "processing" )
func ParseUpdateSendSchedule ¶
func ParseUpdateSendSchedule(name string) (UpdateSendSchedule, error)
ParseUpdateSendSchedule attempts to convert a string to a UpdateSendSchedule.
func (UpdateSendSchedule) IsValid ¶
func (x UpdateSendSchedule) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (UpdateSendSchedule) String ¶
func (x UpdateSendSchedule) String() string
String implements the Stringer interface.
type UpdateStat ¶
type UpdateStat struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` Reference Reference `json:"reference,omitempty"` UpdateID uuid.UUID `json:"update_id,omitempty"` TotalOpens int64 `json:"total_opens,omitempty"` TotalReactions int64 `json:"total_reactions,omitempty"` TotalClicks int64 `json:"total_clicks,omitempty"` TotalSent int64 `json:"total_sent,omitempty"` UniqueOpens int64 `json:"unique_opens,omitempty"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty"` bun.BaseModel `json:"-"` }
type UpdateStatus ¶
type UpdateStatus string
ENUM(draft,sent)
const ( // UpdateStatusDraft is a UpdateStatus of type draft. UpdateStatusDraft UpdateStatus = "draft" // UpdateStatusSent is a UpdateStatus of type sent. UpdateStatusSent UpdateStatus = "sent" )
func ParseUpdateStatus ¶
func ParseUpdateStatus(name string) (UpdateStatus, error)
ParseUpdateStatus attempts to convert a string to a UpdateStatus.
func (UpdateStatus) IsValid ¶
func (x UpdateStatus) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (UpdateStatus) String ¶
func (x UpdateStatus) String() string
String implements the Stringer interface.
type UpdateType ¶
type UpdateType string
ENUM(preview,live)
const ( // UpdateTypePreview is a UpdateType of type preview. UpdateTypePreview UpdateType = "preview" // UpdateTypeLive is a UpdateType of type live. UpdateTypeLive UpdateType = "live" )
func ParseUpdateType ¶
func ParseUpdateType(name string) (UpdateType, error)
ParseUpdateType attempts to convert a string to a UpdateType.
func (UpdateType) IsValid ¶
func (x UpdateType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (UpdateType) String ¶
func (x UpdateType) String() string
String implements the Stringer interface.
type User ¶
type User struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id"` Email Email `json:"email"` FullName string `json:"full_name"` Metadata *UserMetadata `json:"metadata" ` Roles UserRoles `json:"roles" bun:"rel:has-many,join:id=user_id"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at" ` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at" ` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty" ` bun.BaseModel `bun:"table:users" json:"-"` }
func (*User) CanAccessWorkspace ¶ added in v0.3.1
func (*User) HasWorkspace ¶
type UserMetadata ¶
type UserMetadata struct { // Used to keep track of the last used workspace // In the instance of multiple workspaces // So when next the user logs in, we remember and take them to the // right place rather than always a list of all their workspaces and they // have to select one CurrentWorkspace uuid.UUID `json:"current_workspace"` }
type UserRepository ¶
type UserRole ¶
type UserRole struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` Role Role `json:"role,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` WorkspaceID uuid.UUID `json:"workspace_id,omitempty"` UserID uuid.UUID `json:"user_id,omitempty"` bun.BaseModel `bun:"table:roles" json:"-"` }
type UuidGenerator ¶
func NewGoogleUUID ¶
func NewGoogleUUID() UuidGenerator
type Workspace ¶
type Workspace struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` WorkspaceName string `json:"workspace_name,omitempty"` Reference string `json:"reference,omitempty"` Timezone string `json:"timezone,omitempty"` Website string `json:"website,omitempty"` LogoURL string `json:"logo_url,omitempty"` // Not required // Dummy values work really if not using stripe StripeCustomerID string `json:"stripe_customer_id,omitempty"` SubscriptionID string `json:"subscription_id,omitempty"` IsSubscriptionActive bool `json:"is_subscription_active,omitempty"` PlanID uuid.UUID `json:"plan_id,omitempty"` Plan *Plan `json:"plan,omitempty" bun:"rel:belongs-to,join:plan_id=id"` Metadata WorkspaceMetadata `json:"metadata,omitempty"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty" bson:"created_at"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty" bson:"updated_at"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty" bson:"deleted_at"` bun.BaseModel `json:"-"` }
type WorkspaceIntegration ¶ added in v0.3.1
type WorkspaceIntegration struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4(),pk" json:"id,omitempty"` Reference Reference `json:"reference,omitempty"` WorkspaceID uuid.UUID `json:"workspace_id,omitempty"` IntegrationID uuid.UUID `json:"integration_id,omitempty"` Integration *Integration `bun:"rel:belongs-to,join:integration_id=id" json:"integration,omitempty"` IsEnabled bool `json:"is_enabled,omitempty"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty"` bun.BaseModel `json:"-"` }
type WorkspaceIntegrationMetadata ¶ added in v0.3.1
type WorkspaceIntegrationMetadata struct { }
type WorkspaceMetadata ¶ added in v0.4.0
type WorkspaceMetadata struct { }
type WorkspaceRepository ¶
type WorkspaceRepository interface { Create(context.Context, *CreateWorkspaceOptions) error Get(context.Context, *FindWorkspaceOptions) (*Workspace, error) Update(context.Context, *Workspace) error List(context.Context, *User) ([]Workspace, error) MarkInActive(context.Context, *Workspace) error MarkActive(context.Context, *Workspace) error }
Source Files ¶
- blocknote.go
- contact.go
- contact_enum.go
- contact_list.go
- dashboard.go
- deck.go
- errors.go
- generate.go
- image.go
- integration.go
- integration_enum.go
- paginator.go
- password.go
- plan.go
- preferences.go
- reference.go
- reference_enum.go
- share.go
- share_enum.go
- swagger.go
- update.go
- update_enum.go
- user.go
- user_enum.go
- uuid.go
- workspace.go
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
pkg/jwttoken/mocks
Package mock_jwttoken is a generated GoMock package.
|
Package mock_jwttoken is a generated GoMock package. |
pkg/socialauth/mocks
Package socialauth_mocks is a generated GoMock package.
|
Package socialauth_mocks is a generated GoMock package. |
Package malak_mocks is a generated GoMock package.
|
Package malak_mocks is a generated GoMock package. |
Package swagger Code generated by swaggo/swag.
|
Package swagger Code generated by swaggo/swag. |
tools
|
|