MCPcopy Create free account

hub / github.com/belak/gitdir / functions

Functions168 in github.com/belak/gitdir

↓ 17 callersMethodString
String implements Stringer.
repo.go:25
↓ 15 callersMethodcheckListsForUser
(username string, userLists ...[]string)
repo_perms.go:68
↓ 13 callersMethodError
()
utils.go:37
↓ 11 callersFunctionnewMultiError
(errors ...error)
utils.go:21
↓ 10 callersMethodEnsureKey
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 callersFunctionNewAdminConfigUser
NewAdminConfigUser returns a blank AdminConfigUser.
models/admin_config.go:28
↓ 9 callersFunctionlookupAndCheck
(t *testing.T, c *Config, u *User, path string, access AccessLevel)
repo_test.go:278
↓ 7 callersFunctionEnsureRepo
EnsureRepo will open a repository if it exists and try to create it if it doesn't.
internal/git/repository.go:68
↓ 7 callersFunctionNewConfig
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 callersFunctionNewMappingNode
NewMappingNode returns a new node pointing to a yaml map.
internal/yaml/node.go:13
↓ 7 callersFunctionnewTestConfig
()
repo_test.go:30
↓ 7 callersFunctionwriteStringFmt
(w io.Writer, format string, args ...interface{})
utils.go:65
↓ 6 callersMethodCheckout
Checkout will checkout the given hash to the worktreeFS. If an empty string is given, we checkout master.
internal/git/repository.go:112
↓ 6 callersMethodGetFile
GetFile is a convenience method to get the contents of a file in the repo.
internal/git/operations.go:11
↓ 6 callersMethoddoesGroupContainUser
(username string, groupName string, groupPath []string)
repo_perms.go:42
↓ 5 callersFunctionCtxLogger
CtxLogger pulls the logger out of the context, or the default logger if not found.
context.go:77
↓ 5 callersMethodLoad
Load will load the config from the given fs.
config.go:54
↓ 4 callersFunctionCtxUser
CtxUser pulls the current User out of the context, or AnonymousUser if not set.
context.go:56
↓ 4 callersMethodLookupRepoAccess
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 callersMethodLookupUserFromKey
LookupUserFromKey looks up a user object given their PublicKey.
user.go:51
↓ 4 callersMethodMarshalAuthorizedKey
MarshalAuthorizedKey converts a key to the authorized keys format, including a comment.
models/public_key.go:67
↓ 4 callersFunctionParsePublicKey
ParsePublicKey will return a PublicKey from the given data.
models/public_key.go:20
↓ 4 callersMethodPath
Path returns the full path to this repository on disk. This is relative to the gitdir root.
repo.go:54
↓ 4 callersMethodRawMarshalAuthorizedKey
RawMarshalAuthorizedKey converts a key to the authorized keys format, without the comment.
models/public_key.go:57
↓ 4 callersMethodUpdateFile
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 callersFunctionCtxConfig
CtxConfig pulls the current Config out of the context, or a blank Config if not set.
context.go:40
↓ 3 callersFunctionCtxPublicKey
CtxPublicKey pulls the public key out of the context, or nil if not found.
context.go:91
↓ 3 callersFunctionNewScalarNode
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 callersMethodloadConfig
(adminRepo *git.Repository)
config.go:77
↓ 3 callersFunctionnewTestRepoConfig
()
repo_test.go:22
↓ 3 callersMethodopenAdminRepo
()
config.go:63
↓ 2 callersMethodCommit
Commit is a convenience method to make working with the worktree a little bit easier.
internal/git/operations.go:76
↓ 2 callersFunctionCtxExtract
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 callersMethodEncode
Encode is a convenience function which will encode the given node to a byte slice.
internal/yaml/encode.go:11
↓ 2 callersMethodEnsureConfig
()
config.go:98
↓ 2 callersFunctionEnsureDocument
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 callersMethodFS
FS returns the billy.Filesystem for this base path.
cmd/gitdir/config.go:31
↓ 2 callersMethodKeyIndex
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 callersMethodLookupUserFromUsername
LookupUserFromUsername looks up a user objects given their username.
user.go:31
↓ 2 callersMethodMarshalPrivateKey
()
models/private_key.go:20
↓ 2 callersFunctionNewOrgConfig
NewOrgConfig returns a new, empty OrgConfig.
models/org_config.go:17
↓ 2 callersFunctionNewUserConfig
NewUserConfig returns a new, empty UserConfig.
models/user_config.go:16
↓ 2 callersMethodReload
Reload reloads the server config in a thread-safe way.
ssh_server.go:81
↓ 2 callersMethodValidate
Validate will ensure the config is valid and return any errors.
config_validate.go:12
↓ 2 callersMethodcmdRepoAction
(ctx context.Context, s ssh.Session, cmd []string, access AccessLevel)
ssh_commands.go:33
↓ 2 callersFunctiondirExists
(fs billy.Filesystem, path string)
internal/git/utils.go:18
↓ 2 callersMethodensureAdminConfig
(repo *git.Repository)
config_admin.go:8
↓ 2 callersMethodflatten
()
config.go:180
↓ 2 callersFunctiongetExitStatusFromError
(err error)
utils.go:70
↓ 2 callersFunctionlistContainsStr
(list []string, target string)
utils.go:49
↓ 2 callersMethodlookupRepo
(path string)
repo.go:94
↓ 2 callersFunctionmustParsePK
(data string)
repo_test.go:13
↓ 2 callersMethodreloadUnlocked
(config *Config)
ssh_server.go:103
↓ 2 callersFunctionremove
(slice []*yaml.Node, s int)
internal/yaml/utils.go:7
↓ 2 callersFunctionsanitize
(in string)
utils.go:83
↓ 2 callersFunctionwriteIfDifferent
(fs billy.Basic, path string, data []byte)
internal/git/repository.go:166
↓ 1 callersMethodAppendNode
AppendNode will append a value to a SequenceNode.
internal/yaml/operations.go:69
↓ 1 callersMethodAppendUniqueScalar
AppendNode will append a scalar to a SequenceNode if it does not already exist.
internal/yaml/operations.go:75
↓ 1 callersMethodCreateFile
CreateFile is a convenience method to set the contents of a file in the repo and stage it.
internal/git/operations.go:44
↓ 1 callersFunctionCtxSetConfig
CtxSetConfig puts the given Config into the ssh.Context.
context.go:34
↓ 1 callersFunctionCtxSetLogger
CtxSetLogger puts the given logger into the ssh.Context.
context.go:71
↓ 1 callersFunctionCtxSetPublicKey
CtxSetPublicKey puts the given public key into the ssh.Context.
context.go:86
↓ 1 callersFunctionCtxSetUser
CtxSetUser puts the given User into the ssh.Context.
context.go:50
↓ 1 callersMethodEnsureAdminUser
(username string, pubKey *models.PublicKey)
ssh_server.go:52
↓ 1 callersMethodEnsureAdminUser
EnsureUser will load the current admin config and ensure the given user exists.
config.go:139
↓ 1 callersMethodFileExists
FileExists returns true if the given path exists and is a regular file in the repository worktree.
internal/git/operations.go:22
↓ 1 callersFunctionGenerateEd25519PrivateKey
GenerateEd25519PrivateKey generates a new ed25519 private key.
models/private_key.go:45
↓ 1 callersFunctionGenerateRSAPrivateKey
GenerateRSAPrivateKey generates a new RSA private key of size 4096.
models/private_key.go:95
↓ 1 callersMethodGetAdminConfig
GetAdminConfig returns the current admin config in a thread-safe manner. The config should not be modified.
ssh_server.go:137
↓ 1 callersMethodListenAndServe
ListenAndServe listens on the Addr set on the server struct for new SSH connections.
ssh_server.go:126
↓ 1 callersMethodLookupUserFromInvite
LookupUserFromInvite looks up a user object given an invite code.
user.go:83
↓ 1 callersFunctionNewAdminConfig
NewAdminConfig returns a blank admin config with any defaults set.
models/admin_config.go:79
↓ 1 callersFunctionNewEnvConfig
NewEnvConfig returns a new Config based on environment variables.
cmd/gitdir/config.go:46
↓ 1 callersFunctionNewRepoConfig
NewRepoConfig returns a blank RepoConfig.
models/repo_config.go:18
↓ 1 callersFunctionNewSequenceNode
NewSequenceNode returns a new node pointing to a yaml list.
internal/yaml/node.go:20
↓ 1 callersFunctionOpen
Open will open a repository if it exists.
internal/git/repository.go:34
↓ 1 callersFunctionParseAdminConfig
ParseAdminConfig will return an AdminConfig parsed from the given data. No additional validation is done.
models/admin_config.go:95
↓ 1 callersFunctionParseEd25519PrivateKey
ParseEd25519PrivateKey parses an ed25519 private key.
models/private_key.go:28
↓ 1 callersFunctionParseOrgConfig
ParseOrgConfig will return an OrgConfig parsed from the given data. No additional validation is done.
models/org_config.go:25
↓ 1 callersFunctionParseRSAPrivateKey
ParseRSAPrivateKey parses an RSA private key.
models/private_key.go:80
↓ 1 callersFunctionParseUserConfig
ParseUserConfig will return an UserConfig parsed from the given data. No additional validation is done.
models/user_config.go:24
↓ 1 callersMethodRemoveKey
RemoveKey will remove a given key and value from a MappingNode.
internal/yaml/operations.go:10
↓ 1 callersMethodRunHook
RunHook will run the given hook.
hooks.go:13
↓ 1 callersMethodSetHash
SetHash will set the hash of the admin repo to use when loading.
config.go:190
↓ 1 callersMethodSetOrgHash
SetOrgHash will set the hash of the given org repo to use when loading.
config.go:224
↓ 1 callersMethodSetUserHash
SetUserHash will set the hash of the given user repo to use when loading.
config.go:207
↓ 1 callersMethodValueNode
ValueNode returns the given value node for a key, or nil if not found.
internal/yaml/node.go:66
↓ 1 callersFunctionWithLogger
WithLogger takes a parent context and a logger and returns a new context with that logger.
context.go:66
↓ 1 callersMethodcheckUserRepoAccess
TODO: clean up nolint here.
repo_perms.go:87
↓ 1 callersMethodcmdGitReceivePack
(ctx context.Context, s ssh.Session, cmd []string)
ssh_commands.go:25
↓ 1 callersMethodcmdGitUploadPack
(ctx context.Context, s ssh.Session, cmd []string)
ssh_commands.go:29
↓ 1 callersFunctioncmdHook
(c Config)
cmd/gitdir/cmd_hook.go:14
↓ 1 callersFunctioncmdNotFound
(ctx context.Context, s ssh.Session, cmd []string)
ssh_commands.go:20
↓ 1 callersFunctioncmdServe
(c Config)
cmd/gitdir/cmd_serve.go:9
↓ 1 callersFunctioncmdWhoami
(ctx context.Context, s ssh.Session, cmd []string)
ssh_commands.go:13
↓ 1 callersMethodensureAdminConfigYaml
(repo *git.Repository)
config_admin.go:16
↓ 1 callersMethodensureAdminEd25519Key
(repo *git.Repository)
config_admin.go:26
↓ 1 callersMethodensureAdminRSAKey
(repo *git.Repository)
config_admin.go:41
↓ 1 callersFunctionensureAdminUser
(data []byte, username, pubKey string)
config_ensure.go:220
↓ 1 callersMethodensureAdminUser
(repo *git.Repository, user string, pubKey *models.PublicKey)
config_admin.go:20
next →1–100 of 168, ranked by callers