Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/belak/gitdir
/ functions
Functions
168 in github.com/belak/gitdir
⨍
Functions
168
◇
Types & classes
25
↓ 17 callers
Method
String
String implements Stringer.
repo.go:25
↓ 15 callers
Method
checkListsForUser
(username string, userLists ...[]string)
repo_perms.go:68
↓ 13 callers
Method
Error
()
utils.go:37
↓ 11 callers
Function
newMultiError
(errors ...error)
utils.go:21
↓ 10 callers
Method
EnsureKey
EnsureKey ensures that a given key exists. If it doesn't, it adds it with the value pointing to newNode.
internal/yaml/operations.go:36
↓ 9 callers
Function
NewAdminConfigUser
NewAdminConfigUser returns a blank AdminConfigUser.
models/admin_config.go:28
↓ 9 callers
Function
lookupAndCheck
(t *testing.T, c *Config, u *User, path string, access AccessLevel)
repo_test.go:278
↓ 7 callers
Function
EnsureRepo
EnsureRepo will open a repository if it exists and try to create it if it doesn't.
internal/git/repository.go:68
↓ 7 callers
Function
NewConfig
NewConfig returns an empty config, attached to the given fs. In general, Load should be called after creating a new config at a bare minimum.
config.go:35
↓ 7 callers
Function
NewMappingNode
NewMappingNode returns a new node pointing to a yaml map.
internal/yaml/node.go:13
↓ 7 callers
Function
newTestConfig
()
repo_test.go:30
↓ 7 callers
Function
writeStringFmt
(w io.Writer, format string, args ...interface{})
utils.go:65
↓ 6 callers
Method
Checkout
Checkout will checkout the given hash to the worktreeFS. If an empty string is given, we checkout master.
internal/git/repository.go:112
↓ 6 callers
Method
GetFile
GetFile is a convenience method to get the contents of a file in the repo.
internal/git/operations.go:11
↓ 6 callers
Method
doesGroupContainUser
(username string, groupName string, groupPath []string)
repo_perms.go:42
↓ 5 callers
Function
CtxLogger
CtxLogger pulls the logger out of the context, or the default logger if not found.
context.go:77
↓ 5 callers
Method
Load
Load will load the config from the given fs.
config.go:54
↓ 4 callers
Function
CtxUser
CtxUser pulls the current User out of the context, or AnonymousUser if not set.
context.go:56
↓ 4 callers
Method
LookupRepoAccess
LookupRepoAccess checks to see if path points to a valid repo and attaches the access level this user has on that repository.
repo.go:83
↓ 4 callers
Method
LookupUserFromKey
LookupUserFromKey looks up a user object given their PublicKey.
user.go:51
↓ 4 callers
Method
MarshalAuthorizedKey
MarshalAuthorizedKey converts a key to the authorized keys format, including a comment.
models/public_key.go:67
↓ 4 callers
Function
ParsePublicKey
ParsePublicKey will return a PublicKey from the given data.
models/public_key.go:20
↓ 4 callers
Method
Path
Path returns the full path to this repository on disk. This is relative to the gitdir root.
repo.go:54
↓ 4 callers
Method
RawMarshalAuthorizedKey
RawMarshalAuthorizedKey converts a key to the authorized keys format, without the comment.
models/public_key.go:57
↓ 4 callers
Method
UpdateFile
UpdateFile is a convenience method to get the contents of a file, pass it to a callback, write the contents back to the file if no error was returned,
internal/git/operations.go:63
↓ 3 callers
Function
CtxConfig
CtxConfig pulls the current Config out of the context, or a blank Config if not set.
context.go:40
↓ 3 callers
Function
CtxPublicKey
CtxPublicKey pulls the public key out of the context, or nil if not found.
context.go:91
↓ 3 callers
Function
NewScalarNode
NewScalarNode returns a new node pointing to a yaml value. To use the default type hinting, use the empty string as the tag.
internal/yaml/node.go:43
↓ 3 callers
Method
loadConfig
(adminRepo *git.Repository)
config.go:77
↓ 3 callers
Function
newTestRepoConfig
()
repo_test.go:22
↓ 3 callers
Method
openAdminRepo
()
config.go:63
↓ 2 callers
Method
Commit
Commit is a convenience method to make working with the worktree a little bit easier.
internal/git/operations.go:76
↓ 2 callers
Function
CtxExtract
CtxExtract is a convenience wrapper around the other context convenience methods to pull out everything you'd want from a request.
context.go:29
↓ 2 callers
Method
Encode
Encode is a convenience function which will encode the given node to a byte slice.
internal/yaml/encode.go:11
↓ 2 callers
Method
EnsureConfig
()
config.go:98
↓ 2 callers
Function
EnsureDocument
EnsureDocument takes data from a yaml file and ensures a basic document structure. It returns the root node, the root content node, or an error if the
internal/yaml/operations.go:94
↓ 2 callers
Method
FS
FS returns the billy.Filesystem for this base path.
cmd/gitdir/config.go:31
↓ 2 callers
Method
KeyIndex
KeyIndex finds the index of the given key or -1 if not found. Note that it will only return an index if index + 1 also exists.
internal/yaml/node.go:55
↓ 2 callers
Method
LookupUserFromUsername
LookupUserFromUsername looks up a user objects given their username.
user.go:31
↓ 2 callers
Method
MarshalPrivateKey
()
models/private_key.go:20
↓ 2 callers
Function
NewOrgConfig
NewOrgConfig returns a new, empty OrgConfig.
models/org_config.go:17
↓ 2 callers
Function
NewUserConfig
NewUserConfig returns a new, empty UserConfig.
models/user_config.go:16
↓ 2 callers
Method
Reload
Reload reloads the server config in a thread-safe way.
ssh_server.go:81
↓ 2 callers
Method
Validate
Validate will ensure the config is valid and return any errors.
config_validate.go:12
↓ 2 callers
Method
cmdRepoAction
(ctx context.Context, s ssh.Session, cmd []string, access AccessLevel)
ssh_commands.go:33
↓ 2 callers
Function
dirExists
(fs billy.Filesystem, path string)
internal/git/utils.go:18
↓ 2 callers
Method
ensureAdminConfig
(repo *git.Repository)
config_admin.go:8
↓ 2 callers
Method
flatten
()
config.go:180
↓ 2 callers
Function
getExitStatusFromError
(err error)
utils.go:70
↓ 2 callers
Function
listContainsStr
(list []string, target string)
utils.go:49
↓ 2 callers
Method
lookupRepo
(path string)
repo.go:94
↓ 2 callers
Function
mustParsePK
(data string)
repo_test.go:13
↓ 2 callers
Method
reloadUnlocked
(config *Config)
ssh_server.go:103
↓ 2 callers
Function
remove
(slice []*yaml.Node, s int)
internal/yaml/utils.go:7
↓ 2 callers
Function
sanitize
(in string)
utils.go:83
↓ 2 callers
Function
writeIfDifferent
(fs billy.Basic, path string, data []byte)
internal/git/repository.go:166
↓ 1 callers
Method
AppendNode
AppendNode will append a value to a SequenceNode.
internal/yaml/operations.go:69
↓ 1 callers
Method
AppendUniqueScalar
AppendNode will append a scalar to a SequenceNode if it does not already exist.
internal/yaml/operations.go:75
↓ 1 callers
Method
CreateFile
CreateFile is a convenience method to set the contents of a file in the repo and stage it.
internal/git/operations.go:44
↓ 1 callers
Function
CtxSetConfig
CtxSetConfig puts the given Config into the ssh.Context.
context.go:34
↓ 1 callers
Function
CtxSetLogger
CtxSetLogger puts the given logger into the ssh.Context.
context.go:71
↓ 1 callers
Function
CtxSetPublicKey
CtxSetPublicKey puts the given public key into the ssh.Context.
context.go:86
↓ 1 callers
Function
CtxSetUser
CtxSetUser puts the given User into the ssh.Context.
context.go:50
↓ 1 callers
Method
EnsureAdminUser
(username string, pubKey *models.PublicKey)
ssh_server.go:52
↓ 1 callers
Method
EnsureAdminUser
EnsureUser will load the current admin config and ensure the given user exists.
config.go:139
↓ 1 callers
Method
FileExists
FileExists returns true if the given path exists and is a regular file in the repository worktree.
internal/git/operations.go:22
↓ 1 callers
Function
GenerateEd25519PrivateKey
GenerateEd25519PrivateKey generates a new ed25519 private key.
models/private_key.go:45
↓ 1 callers
Function
GenerateRSAPrivateKey
GenerateRSAPrivateKey generates a new RSA private key of size 4096.
models/private_key.go:95
↓ 1 callers
Method
GetAdminConfig
GetAdminConfig returns the current admin config in a thread-safe manner. The config should not be modified.
ssh_server.go:137
↓ 1 callers
Method
ListenAndServe
ListenAndServe listens on the Addr set on the server struct for new SSH connections.
ssh_server.go:126
↓ 1 callers
Method
LookupUserFromInvite
LookupUserFromInvite looks up a user object given an invite code.
user.go:83
↓ 1 callers
Function
NewAdminConfig
NewAdminConfig returns a blank admin config with any defaults set.
models/admin_config.go:79
↓ 1 callers
Function
NewEnvConfig
NewEnvConfig returns a new Config based on environment variables.
cmd/gitdir/config.go:46
↓ 1 callers
Function
NewRepoConfig
NewRepoConfig returns a blank RepoConfig.
models/repo_config.go:18
↓ 1 callers
Function
NewSequenceNode
NewSequenceNode returns a new node pointing to a yaml list.
internal/yaml/node.go:20
↓ 1 callers
Function
Open
Open will open a repository if it exists.
internal/git/repository.go:34
↓ 1 callers
Function
ParseAdminConfig
ParseAdminConfig will return an AdminConfig parsed from the given data. No additional validation is done.
models/admin_config.go:95
↓ 1 callers
Function
ParseEd25519PrivateKey
ParseEd25519PrivateKey parses an ed25519 private key.
models/private_key.go:28
↓ 1 callers
Function
ParseOrgConfig
ParseOrgConfig will return an OrgConfig parsed from the given data. No additional validation is done.
models/org_config.go:25
↓ 1 callers
Function
ParseRSAPrivateKey
ParseRSAPrivateKey parses an RSA private key.
models/private_key.go:80
↓ 1 callers
Function
ParseUserConfig
ParseUserConfig will return an UserConfig parsed from the given data. No additional validation is done.
models/user_config.go:24
↓ 1 callers
Method
RemoveKey
RemoveKey will remove a given key and value from a MappingNode.
internal/yaml/operations.go:10
↓ 1 callers
Method
RunHook
RunHook will run the given hook.
hooks.go:13
↓ 1 callers
Method
SetHash
SetHash will set the hash of the admin repo to use when loading.
config.go:190
↓ 1 callers
Method
SetOrgHash
SetOrgHash will set the hash of the given org repo to use when loading.
config.go:224
↓ 1 callers
Method
SetUserHash
SetUserHash will set the hash of the given user repo to use when loading.
config.go:207
↓ 1 callers
Method
ValueNode
ValueNode returns the given value node for a key, or nil if not found.
internal/yaml/node.go:66
↓ 1 callers
Function
WithLogger
WithLogger takes a parent context and a logger and returns a new context with that logger.
context.go:66
↓ 1 callers
Method
checkUserRepoAccess
TODO: clean up nolint here.
repo_perms.go:87
↓ 1 callers
Method
cmdGitReceivePack
(ctx context.Context, s ssh.Session, cmd []string)
ssh_commands.go:25
↓ 1 callers
Method
cmdGitUploadPack
(ctx context.Context, s ssh.Session, cmd []string)
ssh_commands.go:29
↓ 1 callers
Function
cmdHook
(c Config)
cmd/gitdir/cmd_hook.go:14
↓ 1 callers
Function
cmdNotFound
(ctx context.Context, s ssh.Session, cmd []string)
ssh_commands.go:20
↓ 1 callers
Function
cmdServe
(c Config)
cmd/gitdir/cmd_serve.go:9
↓ 1 callers
Function
cmdWhoami
(ctx context.Context, s ssh.Session, cmd []string)
ssh_commands.go:13
↓ 1 callers
Method
ensureAdminConfigYaml
(repo *git.Repository)
config_admin.go:16
↓ 1 callers
Method
ensureAdminEd25519Key
(repo *git.Repository)
config_admin.go:26
↓ 1 callers
Method
ensureAdminRSAKey
(repo *git.Repository)
config_admin.go:41
↓ 1 callers
Function
ensureAdminUser
(data []byte, username, pubKey string)
config_ensure.go:220
↓ 1 callers
Method
ensureAdminUser
(repo *git.Repository, user string, pubKey *models.PublicKey)
config_admin.go:20
next →
1–100 of 168, ranked by callers