add variable and method comments

This commit is contained in:
Mike Mason
2023-07-17 19:02:55 +00:00
parent 2681b3d064
commit bc87fa7726
35 changed files with 157 additions and 16 deletions

View File

@@ -29,8 +29,10 @@ var DefaultPrefixMap = map[string]ObjectType{
TypeUser.Prefix(): TypeUser,
}
// ObjectType defines a type of object.
type ObjectType string
// Prefix returns the objects id prefix.
func (t ObjectType) Prefix() string {
switch t {
case TypeOrganization:
@@ -44,6 +46,7 @@ func (t ObjectType) Prefix() string {
}
}
// String returns a string fo the object type.
func (t ObjectType) String() string {
return string(t)
}
@@ -96,6 +99,7 @@ func (r prefixedID) PrefixedID() gidx.PrefixedID {
return r.id
}
// New creates a new service.
func New(publisher *events.Publisher, metal *metal.Client, perms *permissions.Client, options ...Option) (Service, error) {
svc := &service{
publisher: publisher,