Documentation
¶
Index ¶
- Constants
- type PgGit
- func (pgt *PgGit) Config() *pgPlug.Config
- func (pgt *PgGit) DeleteBranch(ctx context.Context, branch string) error
- func (pgt *PgGit) DeleteBranchKey(ctx context.Context, branch, key string) error
- func (pgt *PgGit) MergeToBranch(ctx context.Context, branch string) error
- func (pgt *PgGit) Plugin() plugins.IPlugin
- func (pgt *PgGit) PreloadByVersion() error
- func (pgt *PgGit) Read(file, key string) ([]byte, error)
- func (pgt *PgGit) ReplaceFromBranch(ctx context.Context, branch string) error
- func (pgt *PgGit) Save(file, key string, data []byte) error
- func (pgt *PgGit) SetVersion(branch string) error
Constants ¶
View Source
const ( CreateTableSql = ` CREATE TABLE IF NOT EXISTS %s ( id serial, ` + fileNameCol + ` character varying(40) COLLATE pg_catalog."default" NOT NULL, ` + keyCol + ` character varying(40) COLLATE pg_catalog."default" NOT NULL, ` + versionCol + ` character varying(500) COLLATE pg_catalog."default" NOT NULL, ` + dataCol + ` bytea, date_create timestamp without time zone NOT NULL DEFAULT now(), CONSTRAINT %s_pkey PRIMARY KEY (id), CONSTRAINT %s_uxk UNIQUE (file_name, key, version) WITH (FILLFACTOR=100) ) ` DeleteBranchKeySql = `DELETE FROM %s WHERE ` + versionCol + ` = $1 AND ` + keyCol + ` = $2` DeleteBranchSql = `DELETE FROM %s WHERE ` + versionCol + ` = $1` UpdateBranchSql = `UPDATE %s SET ` + versionCol + ` = $1 WHERE ` + versionCol + ` = $2` CopyBranchSql = ` INSERT INTO %s (` + fileNameCol + `, ` + keyCol + `, ` + dataCol + `, ` + versionCol + `) (SELECT ` + fileNameCol + `, ` + keyCol + `, ` + dataCol + `, $1 As ` + versionCol + ` FROM %s WHERE ` + versionCol + ` = $2) ` )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PgGit ¶
type PgGit struct {
// contains filtered or unexported fields
}
func (*PgGit) DeleteBranch ¶ added in v0.0.2
DeleteBranch just cleans brunch's files
func (*PgGit) DeleteBranchKey ¶ added in v0.0.4
DeleteBranchKey just removes one key from brunch's files
func (*PgGit) MergeToBranch ¶ added in v0.0.2
MergeToBranch moves all current branch files to incoming branch.
func (*PgGit) PreloadByVersion ¶ added in v0.0.7
PreloadByVersion loads data by 1 request
func (*PgGit) ReplaceFromBranch ¶ added in v0.0.2
ReplaceFromBranch replaces all current branch files from incoming branch.
func (*PgGit) SetVersion ¶
Click to show internal directories.
Click to hide internal directories.