Files
core/http/graph/resolver/about.resolvers.go
Jan Stabenow eb1cc37456 Add GoSRT & improvements (repo-merge)
Commits (Ingo Oppermann):
- Add experimental SRT connection stats and logs
- Hide /config/reload endpoint in reade-only mode
- Add SRT server
- Create v16 in go.mod
- Fix data races, tests, lint, and update dependencies
- Add trailing slash for routed directories (datarhei/restreamer#340)
- Allow relative URLs in content in static routes

Co-Authored-By: Ingo Oppermann <57445+ioppermann@users.noreply.github.com>
2022-06-23 22:13:58 +02:00

36 lines
974 B
Go

package resolver
// This file will be automatically regenerated based on the schema, any resolver implementations
// will be copied through when generating and any unknown code will be moved to the end.
import (
"context"
"time"
"github.com/datarhei/core/v16/app"
"github.com/datarhei/core/v16/http/graph/models"
"github.com/datarhei/core/v16/http/graph/scalars"
)
func (r *queryResolver) About(ctx context.Context) (*models.About, error) {
createdAt := r.Restream.CreatedAt()
about := &models.About{
App: app.Name,
ID: r.Restream.ID(),
Name: r.Restream.Name(),
CreatedAt: createdAt,
UptimeSeconds: scalars.Uint64(time.Since(createdAt).Seconds()),
Version: &models.AboutVersion{
Number: app.Version.String(),
RepositoryCommit: app.Commit,
RepositoryBranch: app.Branch,
BuildDate: app.Build,
Arch: app.Arch,
Compiler: app.Compiler,
},
}
return about, nil
}