Documentation ¶
Index ¶
Constants ¶
View Source
const ( CL_DEFAULT_ID = ChangelogID("cl_config") GH_DEFAULT_ID = GHSourceID("gh_config") WS_DEFAULT_ID = WorkspaceID("ws_config") )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Changelog ¶
type Changelog struct { WorkspaceID WorkspaceID ID ChangelogID Subdomain Subdomain Domain Domain Title apitypes.NullString Subtitle apitypes.NullString LogoSrc apitypes.NullString LogoLink apitypes.NullString LogoAlt apitypes.NullString LogoHeight apitypes.NullString LogoWidth apitypes.NullString ColorScheme ColorScheme Analytics bool HidePoweredBy bool Protected bool Searchable bool PasswordHash string CreatedAt time.Time GHSource null.Value[GHSource] LocalSource null.Value[LocalSource] }
type ChangelogID ¶
type ChangelogID string
func NewCID ¶
func NewCID() ChangelogID
func ParseCID ¶
func ParseCID(id string) (ChangelogID, error)
func (ChangelogID) String ¶
func (i ChangelogID) String() string
type ColorScheme ¶ added in v0.1.5
type ColorScheme int
const ( System ColorScheme = 1 Light ColorScheme = 2 Dark ColorScheme = 3 )
func NewColorScheme ¶ added in v0.1.5
func NewColorScheme(cs apitypes.ColorScheme) ColorScheme
func (*ColorScheme) Scan ¶ added in v0.1.5
func (cs *ColorScheme) Scan(value interface{}) error
func (ColorScheme) String ¶ added in v0.1.5
func (cs ColorScheme) String() string
func (ColorScheme) ToApiTypes ¶ added in v0.1.5
func (cs ColorScheme) ToApiTypes() apitypes.ColorScheme
type Domain ¶ added in v0.1.2
type Domain apitypes.NullString
func ParseDomain ¶ added in v0.1.2
strips everything from domain except the host
func ParseDomainNullString ¶ added in v0.1.4
func ParseDomainNullString(ns apitypes.NullString) (Domain, error)
if ns is valid, it parses the domain by stripping everything except the host from the string.
func (Domain) NullString ¶ added in v0.1.4
func (d Domain) NullString() apitypes.NullString
type GHSource ¶
type GHSource struct { ID GHSourceID WorkspaceID WorkspaceID Owner string Repo string Path string InstallationID int64 }
type GHSourceID ¶
type GHSourceID string
func NewGHID ¶
func NewGHID() GHSourceID
func ParseGHID ¶
func ParseGHID(id string) (GHSourceID, error)
func (GHSourceID) String ¶
func (i GHSourceID) String() string
type LocalSource ¶
type LocalSource struct {
Path string
}
type Store ¶
type Store interface { GetChangelog(context.Context, WorkspaceID, ChangelogID) (Changelog, error) GetChangelogByDomainOrSubdomain(ctx context.Context, domain Domain, subdomain Subdomain) (Changelog, error) ListChangelogs(context.Context, WorkspaceID) ([]Changelog, error) CreateChangelog(context.Context, Changelog) (Changelog, error) UpdateChangelog(context.Context, WorkspaceID, ChangelogID, UpdateChangelogArgs) (Changelog, error) DeleteChangelog(context.Context, WorkspaceID, ChangelogID) error SetChangelogGHSource(context.Context, WorkspaceID, ChangelogID, GHSourceID) error DeleteChangelogSource(context.Context, WorkspaceID, ChangelogID) error // Workspace GetWorkspace(context.Context, WorkspaceID) (Workspace, error) SaveWorkspace(context.Context, Workspace) (Workspace, error) GetWorkspaceIDByToken(ctx context.Context, token string) (WorkspaceID, error) DeleteWorkspace(context.Context, WorkspaceID) error // admin only methods ListWorkspacesChangelogCount(context.Context) ([]WorkspaceChangelogCount, error) // Source CreateGHSource(context.Context, GHSource) (GHSource, error) GetGHSource(context.Context, WorkspaceID, GHSourceID) (GHSource, error) ListGHSources(context.Context, WorkspaceID) ([]GHSource, error) DeleteGHSource(context.Context, WorkspaceID, GHSourceID) error }
func NewConfigStore ¶
Create a new store implementation, backed by the config file
func NewSQLiteStore ¶
type Subdomain ¶ added in v0.1.2
type Subdomain string
func NewSubdomain ¶ added in v0.1.2
func SubdomainFromHost ¶ added in v0.1.2
Returns the subdomain from the host. Returns an error if the host doesn't have a subdomain
func (Subdomain) NullString ¶ added in v0.1.2
func (s Subdomain) NullString() apitypes.NullString
type UpdateChangelogArgs ¶
type UpdateChangelogArgs struct { Title apitypes.NullString Subdomain apitypes.NullString Domain Domain Subtitle apitypes.NullString LogoSrc apitypes.NullString LogoLink apitypes.NullString LogoAlt apitypes.NullString LogoHeight apitypes.NullString LogoWidth apitypes.NullString ColorScheme ColorScheme HidePoweredBy *bool Protected *bool Analytics *bool Searchable *bool PasswordHash apitypes.NullString }
type Workspace ¶
type Workspace struct { ID WorkspaceID Name string Token Token }
type WorkspaceChangelogCount ¶ added in v0.5.2
type WorkspaceID ¶
type WorkspaceID string
func NewWID ¶
func NewWID() WorkspaceID
func ParseWID ¶
func ParseWID(id string) (WorkspaceID, error)
func (WorkspaceID) String ¶
func (i WorkspaceID) String() string
Click to show internal directories.
Click to hide internal directories.