Skip to content

Commit

Permalink
rm unused funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
adwski committed Jan 30, 2024
1 parent 970c070 commit f905db6
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 49 deletions.
4 changes: 0 additions & 4 deletions internal/api/user/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ func NewService(cfg *ServiceConfig) (*Service, error) {
return svc, nil
}

func (svc *Service) Handler() http.Handler {
return svc.Echo
}

func (svc *Service) register(c echo.Context) error {
req, err := getUserRequest(c)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions internal/api/video/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ func (v *Video) IsReady() bool {
return v.Status == StatusReady
}

func (v *Video) IsCreated() bool {
return v.Status == StatusCreated
}

func (v *Video) IsErrored() bool {
return v.Status == StatusError
}
4 changes: 0 additions & 4 deletions internal/api/video/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ func NewService(cfg *ServiceConfig) (*Service, error) {
return svc, nil
}

func (svc *Service) Handler() http.Handler {
return svc.Echo
}

func (svc *Service) getUploadURL(sess *session.Session) string {
return fmt.Sprintf("%s/%s", svc.uploadURLPrefix, sess.ID)
}
Expand Down
3 changes: 3 additions & 0 deletions internal/api/video/userapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,8 @@ func (svc *Service) storeSessionAndReturnURL(
zap.Error(errSess))
return nil, false
}
svc.logger.Debug("session stored",
zap.String("type", sessStore.Name()),
zap.String("id", sess.ID))
return sess, true
}
17 changes: 0 additions & 17 deletions internal/media/store/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,6 @@ func (s *Store) Put(ctx context.Context, name string, r io.Reader, size int64) e
return nil
}

func (s *Store) GetBytes(ctx context.Context, name string) ([]byte, error) {
rc, size, err := s.Get(ctx, name)
if err != nil {
return nil, err
}
b := make([]byte, size)
_, errR := rc.Read(b)
if errR != nil {
return nil, fmt.Errorf("cannot read object bytes: %w", errR)
}
s.logger.Debug("object retrieved",
zap.String("location", name),
zap.String("bucket", s.bucket),
zap.Int64("size", size))
return b, nil
}

func (s *Store) Get(ctx context.Context, name string) (io.ReadCloser, int64, error) {
obj, err := s.client.GetObject(ctx, s.bucket, name, minio.GetObjectOptions{})
if err != nil {
Expand Down
12 changes: 0 additions & 12 deletions internal/mp4/meta/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@ type Meta struct {
Duration time.Duration
}

func (mc *Meta) TracksInfo() []map[string]string {
out := make([]map[string]string, len(mc.Tracks))
for i, track := range mc.Tracks {
out[i] = map[string]string{
"name": track.Name,
"type": track.MimeType,
"codec": track.Codec.Profile,
}
}
return out
}

// Track is a media file video or audio track.
type Track struct {
Codec *Codec
Expand Down
8 changes: 0 additions & 8 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ func (vec *ViperEC) GetDuration(key string) time.Duration {
return d
}

func (vec *ViperEC) GetStringAllowEmpty(key string) string {
s, err := cast.ToStringE(vec.Get(key))
if err != nil {
vec.errs[key] = err
}
return s
}

func (vec *ViperEC) GetBool(key string) bool {
s, err := cast.ToBoolE(vec.Get(key))
if err != nil {
Expand Down

0 comments on commit f905db6

Please sign in to comment.