githubgist

package
v1.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	AuthMethodNone            = AuthMethod("None")
	AuthMethodPAT             = AuthMethod("PAT")
	AuthMethodOAuthDeviceFlow = AuthMethod("OAuthDeviceFlow")

	SnippetNameModeDescription              = "DESCRIPTION"
	SnippetNameModeFilename                 = "FILENAME"
	SnippetNameModeCombine                  = "COMBINE"
	SnippetNameModeCombinePreferDescription = "COMBINE_PREFER_DESCRIPTION"
)

Variables

View Source
var Key = model.ManagerKey("GitHub Gist")

Functions

func Description

func Description(config *Config) model.ManagerDescription

Types

type AuthMethod

type AuthMethod string

type Config

type Config struct {
	Enabled bool         `yaml:"enabled" head_comment:"If set to false, github gist is disabled completely."`
	Gists   []GistConfig `yaml:"gists" head_comment:"You can define multiple independent GitHub Gist sources."`
}

func AutoDiscoveryConfig

func AutoDiscoveryConfig() *Config

type GistConfig

type GistConfig struct {
	Enabled                   bool            `yaml:"enabled" head_comment:"If set to false, this GitHub gist url is ignored."`
	URL                       string          `yaml:"url" head_comment:"URL to the GitHub gist account."`
	AuthenticationMethod      AuthMethod      `` /* 203-byte string literal not displayed */
	OAuthClientID             string          `` /* 146-byte string literal not displayed */
	IncludeTags               []string        `` /* 129-byte string literal not displayed */
	SuffixRegex               []string        `yaml:"suffixRegex" head_comment:"Only gist files with endings which match one of the listed suffixes will be considered."`
	NameMode                  SnippetNameMode `` /* 186-byte string literal not displayed */
	RemoveTagsFromDescription bool            `yaml:"removeTagsFromDescription" head_comment:"If set to true, any tags will be removed from the description."`
	TitleHeaderEnabled        bool            `` /* 137-byte string literal not displayed */
	HideTitleInPreview        bool            `yaml:"hideTitleInPreview" head_comment:"If set to true, the title header comment will not be shown in the preview window."`
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(options ...Option) (*Manager, error)

func (*Manager) GetSnippets

func (m *Manager) GetSnippets() []model.Snippet

func (Manager) Info

func (m Manager) Info() []model.InfoLine

func (Manager) Key

func (m Manager) Key() model.ManagerKey

func (Manager) SaveAssistantSnippet added in v1.6.0

func (m Manager) SaveAssistantSnippet(snippetTitle string, filename string, contents []byte)

func (*Manager) Sync

func (m *Manager) Sync(events model.SyncEventChannel)

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures a Manager.

func WithCache

func WithCache(cache cache.Cache) Option

func WithConfig

func WithConfig(config Config) Option

func WithSystem

func WithSystem(system *system.System) Option

WithSystem sets the utils.System instance to be used by Manager.

type SnippetNameMode

type SnippetNameMode string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL