Documentation ¶
Index ¶
- Constants
- func GetConfig() (*config.NucleusConfig, error)
- func GetGitDiff() map[string]int
- func GetGitlabCommitDiff() ([]byte, error)
- func GetLogger() (lumber.Logger, error)
- func GetPayload() (*core.Payload, error)
- func GetTaskPayload() (*core.TaskPayload, error)
- func LoadFile(relativePath string) ([]byte, error)
Constants ¶
const ( ApplicationConfigPath = "/testutils/testdata/sample_config.json" // AplicationConfigPath points to dummy config file in json format for NucleusConfig TaskPayloadPath = "/testutils/testdata/taskPayload.json" // TaskPayloadPath points to json file containing dummy TaskPayload PayloadPath = "/testutils/testdata/payload.json" // PayloadPath points to json file containing dummy PayloadPath GitlabCommitDiff = "/testutils/testdata/gitlabCommitDiff.json" // GitLabCommitDiff points to json file containing dummy GitLabCommitDiff )
Various constant defined for to obtain dummy data for tests
Variables ¶
This section is empty.
Functions ¶
func GetConfig ¶
func GetConfig() (*config.NucleusConfig, error)
GetConfig returns a dummy NucleusConfig using the json file pointed by ApplicationConfigPath. It returns error if it is unable to ReadFile from the provided location or if it is unable to Unmarshal the file contents
func GetGitDiff ¶
GetGitDiff returns a dummy map[string]int for testing purpose.
func GetGitlabCommitDiff ¶
GetGitlabCommitDiff returns a dummy GitlabCommitDiff as slice of byte data. Itreturns error if unable to readfile
func GetLogger ¶
GetLogger returns a dummy lumber.Logger. It returns error if it is unable establish logger using lumber.NewLogger function
func GetPayload ¶
GetPayload returns a dummy core.Payload using the json file pointed by PayloadPath. It returns error if unable to readfile or if unable to unmarshal file components
func GetTaskPayload ¶
func GetTaskPayload() (*core.TaskPayload, error)
GetTaskPayload returns a dummy core.TaskPayload using the json file pointed by TaskPayloadPath. It returns error if unable to readfile or if unable to unmarshal file components
Types ¶
This section is empty.