Documentation
¶
Overview ¶
Package branding keeps the workspace's name, browser title and logo (Phase 21). Unset values fall back to SynCloud's own name and the logos in web/public.
Index ¶
- Constants
- func DecodeDataURL(s string) ([]byte, error)
- type Branding
- type ErrInvalid
- type Images
- type Manager
- func (m *Manager) Get() Branding
- func (m *Manager) Images() *Images
- func (m *Manager) Load(ctx context.Context) error
- func (m *Manager) RemoveLogo(ctx context.Context) (Branding, error)
- func (m *Manager) SetLogo(ctx context.Context, data []byte) (Branding, error)
- func (m *Manager) SetText(ctx context.Context, name, title string) (Branding, error)
Constants ¶
const ( // DefaultName is the workspace name until one is set. DefaultName = "SynCloud" // MaxLogoBytes is the largest logo upload. MaxLogoBytes = 512 << 10 )
const ( SizeLogo = 256 SizeFavic = 32 SizeApple = 180 )
Image sizes made from the uploaded logo.
Variables ¶
This section is empty.
Functions ¶
func DecodeDataURL ¶
DecodeDataURL accepts "data:image/png;base64,…" or bare base64.
Types ¶
type Branding ¶
type Branding struct {
Name string `json:"name"`
Title string `json:"title"` // the browser tab; defaults to Name
HasLogo bool `json:"hasLogo"`
// Version changes with every logo upload (cache busting).
Version string `json:"version"`
}
Branding is what the API shows (public).
type ErrInvalid ¶
type ErrInvalid struct{ Err error }
ErrInvalid wraps validation errors.
func (ErrInvalid) Error ¶
func (e ErrInvalid) Error() string
type Images ¶
type Images struct {
Logo, Favicon, Apple []byte
}
Images are the PNG renditions of the logo.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) RemoveLogo ¶
RemoveLogo goes back to the default logo.