NewEntitySource creates a new EntitySource.
( e fs.Entity, handler driver.Handler, policy *ent.StoragePolicy, generalAuth auth.Auth, settings setting.Provider, hasher hashid.Encoder, c request.Client, l logging.Logger, config conf.ConfigProvider, mime mime.MimeDetector, encryptorFactory encrypt.CryptorFactory, opts ...EntitySourceOption, )
| 198 | |
| 199 | // NewEntitySource creates a new EntitySource. |
| 200 | func NewEntitySource( |
| 201 | e fs.Entity, |
| 202 | handler driver.Handler, |
| 203 | policy *ent.StoragePolicy, |
| 204 | generalAuth auth.Auth, |
| 205 | settings setting.Provider, |
| 206 | hasher hashid.Encoder, |
| 207 | c request.Client, |
| 208 | l logging.Logger, |
| 209 | config conf.ConfigProvider, |
| 210 | mime mime.MimeDetector, |
| 211 | encryptorFactory encrypt.CryptorFactory, |
| 212 | opts ...EntitySourceOption, |
| 213 | ) EntitySource { |
| 214 | s := &entitySource{ |
| 215 | e: e, |
| 216 | handler: handler, |
| 217 | policy: policy, |
| 218 | generalAuth: generalAuth, |
| 219 | settings: settings, |
| 220 | hasher: hasher, |
| 221 | c: c, |
| 222 | config: config, |
| 223 | l: l, |
| 224 | mime: mime, |
| 225 | encryptorFactory: encryptorFactory, |
| 226 | o: &EntitySourceOptions{}, |
| 227 | } |
| 228 | for _, opt := range opts { |
| 229 | opt.Apply(s.o) |
| 230 | } |
| 231 | return s |
| 232 | } |
| 233 | |
| 234 | func (f *entitySource) Apply(opts ...EntitySourceOption) { |
| 235 | if len(opts) > 0 { |
no test coverage detected