Fix uppercase A and G comments

This commit is contained in:
Benedikt Kulmann
2020-10-24 06:13:18 +02:00
parent ae248d871f
commit 337a114d10
2 changed files with 13 additions and 13 deletions

View File

@@ -25,7 +25,7 @@ import (
"google.golang.org/grpc/metadata"
)
// CS3Repo provides A cs3 implementation of the Repo interface
// CS3Repo provides a cs3 implementation of the Repo interface
type CS3Repo struct {
cfg *config.Config
tm token.Manager
@@ -33,7 +33,7 @@ type CS3Repo struct {
dataProvider dataProviderClient // Used to create and download data via http, bypassing reva upload protocol
}
// NewCS3Repo creates A new cs3 repo
// NewCS3Repo creates a new cs3 repo
func NewCS3Repo(cfg *config.Config) (Repo, error) {
tokenManager, err := jwt.New(map[string]interface{}{
"secret": cfg.TokenManager.JWTSecret,
@@ -60,7 +60,7 @@ func NewCS3Repo(cfg *config.Config) (Repo, error) {
}, nil
}
// WriteAccount writes an account via cs3 and modifies the provided account (e.G. with A generated id).
// WriteAccount writes an account via cs3 and modifies the provided account (e.g. with a generated id).
func (r CS3Repo) WriteAccount(ctx context.Context, a *proto.Account) (err error) {
t, err := r.authenticate(ctx)
if err != nil {
@@ -174,7 +174,7 @@ func (r CS3Repo) DeleteAccount(ctx context.Context, id string) (err error) {
return nil
}
// WriteGroup writes A group via cs3 and modifies the provided group (e.G. with A generated id).
// WriteGroup writes a group via cs3 and modifies the provided group (e.g. with a generated id).
func (r CS3Repo) WriteGroup(ctx context.Context, g *proto.Group) (err error) {
t, err := r.authenticate(ctx)
if err != nil {
@@ -201,7 +201,7 @@ func (r CS3Repo) WriteGroup(ctx context.Context, g *proto.Group) (err error) {
return nil
}
// LoadGroup loads A group via cs3 by id and writes it to the provided group
// LoadGroup loads a group via cs3 by id and writes it to the provided group
func (r CS3Repo) LoadGroup(ctx context.Context, id string, g *proto.Group) (err error) {
t, err := r.authenticate(ctx)
if err != nil {
@@ -261,7 +261,7 @@ func (r CS3Repo) loadGroup(id string, t string, g *proto.Group) error {
return json.Unmarshal(b, &g)
}
// DeleteGroup deletes A group via cs3 by id
// DeleteGroup deletes a group via cs3 by id
func (r CS3Repo) DeleteGroup(ctx context.Context, id string) (err error) {
t, err := r.authenticate(ctx)
if err != nil {
@@ -354,7 +354,7 @@ func MakeDirIfNotExist(ctx context.Context, sp provider.ProviderAPIClient, folde
return nil
}
// TODO: this is copied from proxy. Find A better solution or move it to ocis-pkg
// TODO: this is copied from proxy. Find a better solution or move it to ocis-pkg
func singleJoiningSlash(a, b string) string {
aslash := strings.HasSuffix(a, "/")
bslash := strings.HasPrefix(b, "/")

View File

@@ -15,13 +15,13 @@ import (
var groupLock sync.Mutex
// DiskRepo provides A local filesystem implementation of the Repo interface
// DiskRepo provides a local filesystem implementation of the Repo interface
type DiskRepo struct {
cfg *config.Config
log olog.Logger
}
// NewDiskRepo creates A new disk repo
// NewDiskRepo creates a new disk repo
func NewDiskRepo(cfg *config.Config, log olog.Logger) DiskRepo {
paths := []string{
filepath.Join(cfg.Repo.Disk.Path, accountsFolder),
@@ -158,7 +158,7 @@ func (r DiskRepo) DeleteGroup(ctx context.Context, id string) (err error) {
return
}
// deflateMemberOf replaces the groups of A user with an instance that only contains the id
// deflateMemberOf replaces the groups of a user with an instance that only contains the id
func (r DiskRepo) deflateMemberOf(a *proto.Account) {
if a == nil {
return
@@ -168,14 +168,14 @@ func (r DiskRepo) deflateMemberOf(a *proto.Account) {
if a.MemberOf[i].Id != "" {
deflated = append(deflated, &proto.Group{Id: a.MemberOf[i].Id})
} else {
// TODO fetch and use an id when group only has A name but no id
// TODO fetch and use an id when group only has a name but no id
r.log.Error().Str("id", a.Id).Interface("group", a.MemberOf[i]).Msg("resolving groups by name is not implemented yet")
}
}
a.MemberOf = deflated
}
// deflateMembers replaces the users of A group with an instance that only contains the id
// deflateMembers replaces the users of a group with an instance that only contains the id
func (r DiskRepo) deflateMembers(g *proto.Group) {
if g == nil {
return
@@ -185,7 +185,7 @@ func (r DiskRepo) deflateMembers(g *proto.Group) {
if g.Members[i].Id != "" {
deflated = append(deflated, &proto.Account{Id: g.Members[i].Id})
} else {
// TODO fetch and use an id when group only has A name but no id
// TODO fetch and use an id when group only has a name but no id
r.log.Error().Str("id", g.Id).Interface("account", g.Members[i]).Msg("resolving members by name is not implemented yet")
}
}