-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from anantadwi13/dev
Update API Specification & Refactor Code
- Loading branch information
Showing
14 changed files
with
1,261 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
FROM golang:1.17 AS builder | ||
|
||
WORKDIR /go/src/bind9 | ||
COPY . . | ||
COPY go.* ./ | ||
RUN go mod download | ||
COPY cmd cmd | ||
COPY internal internal | ||
RUN go mod tidy | ||
RUN GOOS=linux go build -o service ./cmd/service/ | ||
|
||
FROM internetsystemsconsortium/bind9:9.16 | ||
WORKDIR /root | ||
COPY --from=builder /go/src/bind9/service . | ||
COPY specification.yaml . | ||
|
||
VOLUME ["/etc/bind", "/var/cache/bind", "/var/lib/bind", "/var/log", "/data"] | ||
VOLUME ["/var/log", "/data"] | ||
|
||
EXPOSE 53/udp 53/tcp 953/tcp 80/tcp | ||
EXPOSE 53/udp 53/tcp 953/tcp 5555/tcp | ||
|
||
CMD ./service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package internal | ||
package domain | ||
|
||
import "path/filepath" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package internal | ||
package domain | ||
|
||
import "context" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package domain | ||
|
||
import ( | ||
"context" | ||
"github.com/pkg/errors" | ||
) | ||
|
||
type ZoneRepository interface { | ||
GetAllZones(ctx context.Context) ([]*Zone, error) | ||
GetZoneById(ctx context.Context, zoneId string) (*Zone, error) | ||
GetZoneByDomain(ctx context.Context, domain string) (*Zone, error) | ||
|
||
Persist(ctx context.Context, zone *Zone) error | ||
Delete(ctx context.Context, zone *Zone) error | ||
} | ||
|
||
var ErrorZoneNotFound = errors.New("zone is not found") | ||
|
||
type Migration interface { | ||
Migrate(ctx context.Context) error | ||
} |
Oops, something went wrong.