(ctx context.Context, u uri.URI, version int32, input []byte)
| 185 | } |
| 186 | |
| 187 | func (m *Manager) Overwrite(ctx context.Context, u uri.URI, version int32, input []byte) (bool, error) { |
| 188 | m.mu.Lock() |
| 189 | defer m.mu.Unlock() |
| 190 | |
| 191 | if document, found := m.docs[u]; !found { |
| 192 | changed, err := m.parse(ctx, u, document.LanguageIdentifier(), version, input) |
| 193 | if err != nil { |
| 194 | return false, fmt.Errorf("could not parse file %q: %v", u, err) |
| 195 | } |
| 196 | return changed, nil |
| 197 | } |
| 198 | |
| 199 | identifier := protocol.DockerfileLanguage |
| 200 | if strings.HasSuffix(string(u), "hcl") { |
| 201 | identifier = protocol.DockerBakeLanguage |
| 202 | } |
| 203 | return m.write(ctx, u, identifier, version, input) |
| 204 | } |
| 205 | |
| 206 | func (m *Manager) Remove(u uri.URI) { |
| 207 | m.mu.Lock() |
no test coverage detected