• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

fogfish / dynamo / 11990190580

23 Nov 2024 08:27PM UTC coverage: 83.45% (-0.3%) from 83.747%
11990190580

push

github

web-flow
Use fogfish/opts library to declare options (#105)

60 of 68 new or added lines in 14 files covered. (88.24%)

2 existing lines in 2 files now uncovered.

1311 of 1571 relevant lines covered (83.45%)

0.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

72.22
/service/s3/s3.go
1
//
2
// Copyright (C) 2019 Dmitry Kolesnikov
3
//
4
// This file may be modified and distributed under the terms
5
// of the MIT license.  See the LICENSE file for details.
6
// https://github.com/fogfish/dynamo
7
//
8

9
package s3
10

11
import (
12
        "github.com/fogfish/dynamo/v3"
13
        "github.com/fogfish/opts"
14
)
15

16
type Storage[T dynamo.Thing] struct {
17
        Options
18
        codec     *codec[T]
19
        schema    *schema[T]
20
        undefined T
21
}
22

23
// Must constraint for api factory
24
func Must[T dynamo.Thing](keyval *Storage[T], err error) *Storage[T] {
1✔
25
        if err != nil {
1✔
26
                panic(err)
×
27
        }
28

29
        return keyval
1✔
30
}
31

32
// New creates instance of S3 api
33
func New[T dynamo.Thing](opt ...Option) (*Storage[T], error) {
1✔
34
        conf := optsDefault()
1✔
35
        if err := opts.Apply(&conf, opt); err != nil {
1✔
36
                return nil, err
×
37
        }
×
38

39
        if conf.service == nil {
2✔
40
                if err := optsDefaultS3(&conf); err != nil {
1✔
NEW
41
                        return nil, err
×
NEW
42
                }
×
43
        }
44

45
        return &Storage[T]{
1✔
46
                Options: conf,
1✔
47
                codec:   newCodec[T](conf.prefixes),
1✔
48
                schema:  newSchema[T](),
1✔
49
        }, conf.checkRequired()
1✔
50
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc