RuntimeFromStore returns a Runtime for the specified store.
(store storage.Store, options *RuntimeOptions)
| 92 | |
| 93 | // RuntimeFromStore returns a Runtime for the specified store. |
| 94 | func RuntimeFromStore(store storage.Store, options *RuntimeOptions) (*Runtime, error) { |
| 95 | if options == nil { |
| 96 | options = &RuntimeOptions{} |
| 97 | } |
| 98 | |
| 99 | var systemContext types.SystemContext |
| 100 | if options.SystemContext != nil { |
| 101 | systemContext = *options.SystemContext |
| 102 | } else { |
| 103 | systemContext = types.SystemContext{} |
| 104 | } |
| 105 | if systemContext.BigFilesTemporaryDir == "" { |
| 106 | systemContext.BigFilesTemporaryDir = tmpdir() |
| 107 | } |
| 108 | |
| 109 | setRegistriesConfPath(&systemContext) |
| 110 | |
| 111 | return &Runtime{ |
| 112 | store: store, |
| 113 | systemContext: systemContext, |
| 114 | }, nil |
| 115 | } |
| 116 | |
| 117 | // RuntimeFromStoreOptions returns a return for the specified store options. |
| 118 | func RuntimeFromStoreOptions(runtimeOptions *RuntimeOptions, storeOptions *storage.StoreOptions) (*Runtime, error) { |
no test coverage detected
searching dependent graphs…