Documentation ¶
Overview ¶
Package `nogfsostad` implements modules that are combined in `cmd/nogfsostad`.
Package `nogfsostad/observer4`: Watches the FSO registry and initializes repos: FSO shadow repos and GitLab projects.
`Processor`: Coordinates repo initialization, stat, and sha.
`RepoInitializer`: Initializes repos: FSO shadow repos and GitLab projects.
`Session`: Permanent connection to `nogfsoregd` to receive commands.
Package `gits`: Init GitLab projects.
Package `shadows`: FSO shadow repos.
`NewStatServer()`, Package `statd`: GRPC service `nogfso.Stat`.
Index ¶
- Constants
- Variables
- func NewGitNogServer(lg Logger, authn auth.Authenticator, authz auth.Authorizer, proc *Processor) *gitnogd.Server
- func NewStatServer(lg Logger, authn auth.Authenticator, authz auth.Authorizer, proc *Processor, ...) *statd.Server
- type Broadcaster
- func (b *Broadcaster) PostGitContentUpdated(ctx context.Context, repoId uuid.I, newHead shadows.Oid) error
- func (b *Broadcaster) PostGitMetaUpdated(ctx context.Context, repoId uuid.I, newHead shadows.Oid) error
- func (b *Broadcaster) PostGitShaUpdated(ctx context.Context, repoId uuid.I, newHead shadows.Oid) error
- func (b *Broadcaster) PostGitStatUpdated(ctx context.Context, repoId uuid.I, newHead shadows.Oid) error
- type GitNogWritePolicy
- type GitUser
- type InitLimits
- type InitLimitsConfig
- type Logger
- type PathInitLimit
- type Privileges
- type Processor
- func (p *Processor) ArchiveRepo(ctx context.Context, repoId uuid.I, workingDir string, author GitUser) error
- func (p *Processor) DisableRepo4(ctx context.Context, repoId uuid.I) error
- func (p *Processor) EnableRepo4(ctx context.Context, inf *RepoInfo) error
- func (p *Processor) FreezeRepo(ctx context.Context, repoId uuid.I, author GitUser) error
- func (p *Processor) GetTarttconfig(ctx context.Context, repoId uuid.I, gitCommit []byte) ([]byte, error)
- func (p *Processor) GitGcAll(ctx context.Context) error
- func (p *Processor) GitNogContent(ctx context.Context, repoId uuid.I, path string) (*pb.ContentO, error)
- func (p *Processor) GitNogHead(ctx context.Context, repoId uuid.I) (*pb.HeadO, error)
- func (p *Processor) GitNogMeta(ctx context.Context, repoId uuid.I) (*pb.MetaO, error)
- func (p *Processor) GitNogPutPathMetadata(ctx context.Context, repoId uuid.I, i *pb.PutPathMetadataI) (*pb.PutPathMetadataO, error)
- func (p *Processor) GitNogSummary(ctx context.Context, repoId uuid.I) (*pb.SummaryO, error)
- func (p *Processor) GlobalRepoPath(repoId uuid.I) (string, bool)
- func (p *Processor) IsKnownRepo(repoId uuid.I) bool
- func (p *Processor) ListMetaTree(ctx context.Context, repoId uuid.I, gitCommit []byte, ...) error
- func (p *Processor) ListStatTree(ctx context.Context, repoId uuid.I, gitCommit []byte, prefix string, ...) error
- func (p *Processor) ListTars(ctx context.Context, repoId uuid.I, gitCommit []byte, fn shadows.ListTarsFunc) error
- func (p *Processor) LockRepo4(ctx context.Context, repoId uuid.I) error
- func (p *Processor) RefreshContent(ctx context.Context, repoId uuid.I, author statd.User) error
- func (p *Processor) ReinitSubdirTracking(ctx context.Context, repoId uuid.I, author statd.User, ...) error
- func (p *Processor) ResolveGlobaPathInLocalRepo(globalPath string) (repo, sub string, ok bool)
- func (p *Processor) ShaRepo(ctx context.Context, repoId uuid.I, author statd.User) error
- func (p *Processor) StatMtimeRangeOnlyAllRepos(ctx context.Context, author statd.User) error
- func (p *Processor) StatRepo(ctx context.Context, repoId uuid.I, author statd.User, ...) error
- func (p *Processor) StatStatus(ctx context.Context, repoId uuid.I, fn shadows.StatStatusFunc) error
- func (p *Processor) TarttHead(ctx context.Context, repoId uuid.I) (*pb.TarttHeadO, error)
- func (p *Processor) TarttIsFrozenArchive(ctx context.Context, repoId uuid.I) (*shadows.TarttIsFrozenArchiveInfo, error)
- func (p *Processor) UnarchiveRepo(ctx context.Context, repoId uuid.I, workingDir string, author GitUser) error
- func (p *Processor) UnfreezeRepo(ctx context.Context, repoId uuid.I, author GitUser) error
- func (p *Processor) UnlockRepo4(repoId uuid.I)
- func (p *Processor) WaitEnableRepo4(ctx context.Context, id uuid.I) error
- type RepoInfo
- type RepoInitializer4
- func (ri *RepoInitializer4) EnableGitlab(ctx context.Context, repoId uuid.I) (*RepoInfo, error)
- func (ri *RepoInitializer4) GetRepo(ctx context.Context, repoId uuid.I) (*RepoInfo, error)
- func (ri *RepoInitializer4) InitRepo(ctx context.Context, repoId uuid.I) (*RepoInfo, error)
- func (ri *RepoInitializer4) MoveRepo(ctx context.Context, repoId uuid.I, oldHostPath string, oldShadowPath string, ...) (string, error)
- type Session
- type SessionConfig
- type UseUdo
Constants ¶
const AAFsoInitRepo = fsoauthz.AAFsoInitRepo
Variables ¶
var ErrNoSudo = errors.New("no sudo privileges")
Functions ¶
func NewGitNogServer ¶
func NewGitNogServer( lg Logger, authn auth.Authenticator, authz auth.Authorizer, proc *Processor, ) *gitnogd.Server
func NewStatServer ¶
func NewStatServer( lg Logger, authn auth.Authenticator, authz auth.Authorizer, proc *Processor, sysRPCCreds credentials.PerRPCCredentials, ) *statd.Server
Types ¶
type Broadcaster ¶
type Broadcaster struct {
// contains filtered or unexported fields
}
func NewBroadcaster ¶
func NewBroadcaster( lg Logger, conn *grpc.ClientConn, sysRPCCreds credentials.PerRPCCredentials, ) *Broadcaster
func (*Broadcaster) PostGitContentUpdated ¶
func (*Broadcaster) PostGitMetaUpdated ¶
func (*Broadcaster) PostGitShaUpdated ¶
func (*Broadcaster) PostGitStatUpdated ¶
type GitNogWritePolicy ¶
type GitNogWritePolicy int
const ( GitNogWriteUnspecified GitNogWritePolicy = iota // `GitNogWriteAlways` always allows `PutMeta()`. It is the preferred // solution. See NOE-13. GitNogWriteAlways // `GitNogWriteUnlessGitlab` could be an alternative as discussed in // NOE-13. Writes would be forbidden here and only allowed via GitLab // REST. Do not use `GitNogWriteUnlessGitlab` without prior design // discussion. GitNogWriteUnlessGitlab )
type InitLimits ¶
type InitLimits struct {
// contains filtered or unexported fields
}
func NewInitLimits ¶
func NewInitLimits(cfg *InitLimitsConfig) *InitLimits
type InitLimitsConfig ¶
type InitLimitsConfig struct { MaxFiles uint64 MaxBytes uint64 PrefixLimits []PathInitLimit RepoLimits []PathInitLimit }
type PathInitLimit ¶
type Privileges ¶
type Privileges interface { privileges.UdoChattrPrivileges privileges.UdoRenamePrivileges }
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func NewProcessor ¶
func NewProcessor( lg Logger, initLimits *InitLimits, shadow *shadows.Filesystem, broadcaster *Broadcaster, privs Privileges, useUdo UseUdo, ) *Processor
func (*Processor) ArchiveRepo ¶
func (*Processor) DisableRepo4 ¶
`DisableRepo4()` is for `observer4/observer.go:Observer`.
func (*Processor) EnableRepo4 ¶
`EnableRepo4()` is for `observer4/observer.go:Observer`.
func (*Processor) FreezeRepo ¶
func (*Processor) GetTarttconfig ¶
func (*Processor) GitNogContent ¶
func (*Processor) GitNogHead ¶
func (*Processor) GitNogMeta ¶
func (*Processor) GitNogPutPathMetadata ¶
func (p *Processor) GitNogPutPathMetadata( ctx context.Context, repoId uuid.I, i *pb.PutPathMetadataI, ) (*pb.PutPathMetadataO, error)
func (*Processor) GitNogSummary ¶
func (*Processor) ListMetaTree ¶
func (*Processor) ListStatTree ¶
func (*Processor) RefreshContent ¶
func (*Processor) ReinitSubdirTracking ¶
func (*Processor) ResolveGlobaPathInLocalRepo ¶
func (*Processor) StatMtimeRangeOnlyAllRepos ¶
func (*Processor) StatStatus ¶
func (*Processor) TarttIsFrozenArchive ¶
func (*Processor) UnarchiveRepo ¶
func (*Processor) UnfreezeRepo ¶
func (*Processor) UnlockRepo4 ¶
func (*Processor) WaitEnableRepo4 ¶
`WaitEnableRepo4()` waits until the repo has been enabled. It is used to synchronize workflow processing during startup. Specifically if a freeze-repo workflow is restarted, it needs to wait until the repo is enabled before it can call `FreezeRepo()`. It calls `WaitEnableRepo4()` to ensure that.
`WaitEnableRepo4()` is only useful for startup. It does not handle disabling repos later. It may return immediately for such a repo even if the repo is currently disabled.
type RepoInitializer4 ¶
type RepoInitializer4 struct {
// contains filtered or unexported fields
}
func NewRepoInitializer4 ¶
func NewRepoInitializer4( lg Logger, proc *Processor, conn *grpc.ClientConn, sysRPCCreds credentials.PerRPCCredentials, hosts []string, shadow *shadows.Filesystem, broadcaster *Broadcaster, gitlab *gits.Gitlab, ) *RepoInitializer4
func (*RepoInitializer4) EnableGitlab ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession( lg Logger, statd pb.StatServer, gitnogd pb.GitNogServer, gitnogtreed pb.GitNogTreeServer, discoveryd pb.DiscoveryServer, tarttd pb.TarttServer, testUdoD pb.TestUdoServer, cfg *SessionConfig, ) *Session
type SessionConfig ¶
type SessionConfig struct { // IsInitRepoAllowed() Prefixes []string Hosts []string InitLimits *InitLimits SessionName string TransportCredentials credentials.TransportCredentials Authenticator auth.Authenticator Authorizer auth.Authorizer SysRPCCreds credentials.PerRPCCredentials }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package `gits`: Init GitLab projects.
|
Package `gits`: Init GitLab projects. |
Package `observer6` contains `Observer` to watch for registry and repo events and trigger actions on a `Processor`, specifically `nogfsostad.Processor`.
|
Package `observer6` contains `Observer` to watch for registry and repo events and trigger actions on a `Processor`, specifically `nogfsostad.Processor`. |
udodprivileges
Package `privileges/udodprivileges` implements interfaces from `privileges/privileges` by gRPCs to a `privileges/daemons.Daemon`.
|
Package `privileges/udodprivileges` implements interfaces from `privileges/privileges` by gRPCs to a `privileges/daemons.Daemon`. |
Package `shadows`: FSO shadow repos.
|
Package `shadows`: FSO shadow repos. |
Package `statd`: GRPC service `nogfso.Stat`.
|
Package `statd`: GRPC service `nogfso.Stat`. |