-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: implement a new pkg/api desing
Signed-off-by: Kairo Araujo <[email protected]>
- Loading branch information
1 parent
4e6f88d
commit 2554623
Showing
5 changed files
with
186 additions
and
31 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
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package api | ||
|
||
type GraphQLError struct { | ||
Message string `json:"message"` | ||
} | ||
|
||
type GraphQLResponseGeneric[T any] struct { | ||
Data T `json:"data,omitempty"` | ||
Errors []GraphQLError `json:"errors,omitempty"` | ||
} | ||
|
||
type GraphQLRequestBodyGeneric[TVars any] struct { | ||
Query string `json:"query"` | ||
Variables TVars `json:"variables,omitempty"` | ||
} | ||
|
||
type RetrieveSubjectVars struct { | ||
Gitoid string `json:"gitoid"` | ||
} | ||
|
||
type SearchVars struct { | ||
Algorithm string `json:"algo"` | ||
Digest string `json:"digest"` | ||
} | ||
|
||
type RetrieveSubjectResults struct { | ||
Subjects Subjects `json:"subjects"` | ||
} | ||
|
||
type Subjects struct { | ||
Edges []SubjectEdge `json:"edges"` | ||
} | ||
|
||
type SubjectEdge struct { | ||
Node SubjectNode `json:"node"` | ||
} | ||
|
||
type SubjectNode struct { | ||
Name string `json:"name"` | ||
SubjectDigests []SubjectDigest `json:"subjectDigests"` | ||
} | ||
|
||
type SubjectDigest struct { | ||
Algorithm string `json:"algorithm"` | ||
Value string `json:"value"` | ||
} | ||
|
||
type SearchResults struct { | ||
Dsses DSSES `json:"dsses"` | ||
} | ||
|
||
type DSSES struct { | ||
Edges []SearchEdge `json:"edges"` | ||
} | ||
|
||
type SearchEdge struct { | ||
Node SearchNode `json:"node"` | ||
} | ||
|
||
type SearchNode struct { | ||
GitoidSha256 string `json:"gitoidSha256"` | ||
Statement Statement `json:"statement"` | ||
} | ||
|
||
type Statement struct { | ||
AttestationCollection AttestationCollection `json:"attestationCollections"` | ||
} | ||
|
||
type AttestationCollection struct { | ||
Name string `json:"name"` | ||
Attestations []Attestation `json:"attestations"` | ||
} | ||
|
||
type Attestation struct { | ||
Type string `json:"type"` | ||
} |
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