Documentation
¶
Index ¶
- func BuildTaskRespMsg(taskReqMsg *taskpb.TaskReqMsg, respSpec *taskpb.Spec, log *taskpb.Log, ...) *taskpb.TaskRespMsg
- func CountLines(s string) int64
- func CreateTmpDir(dir, prefix string) string
- func CreateTmpFile(dir, filePrefix, content string) string
- func GetFailureTypeFromError(err error) taskpb.FailureType
- func GetGCSGenerationNumCondition(generationNum int64) storage.Conditions
- func IsValidFailureMsg(taskRelRsrcName string, failureType taskpb.FailureType, ...) (bool, string)
- func IsValidSuccessMsg(taskRelRsrcName string, taskRespMsg *taskpb.TaskRespMsg) (bool, string)
- func NewStringReadCloser(s string) *stringReadCloser
- type AgentError
- type StringWriteCloser
- func (m *StringWriteCloser) Attrs() *storage.ObjectAttrs
- func (m *StringWriteCloser) Close() error
- func (m *StringWriteCloser) CloseWithError(err error) error
- func (m *StringWriteCloser) NumberLines() int64
- func (m *StringWriteCloser) Write(p []byte) (int, error)
- func (m *StringWriteCloser) WrittenString() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTaskRespMsg ¶
func BuildTaskRespMsg(taskReqMsg *taskpb.TaskReqMsg, respSpec *taskpb.Spec, log *taskpb.Log, err error) *taskpb.TaskRespMsg
BuildTaskRespMsg constructs and returns a taskResMsg from the params;
taskReqMsg is the taskpb.TaskReqMsg that the task was originally called with respSpec is the taskpb.Spec the updated task spec as a result of this task request lf are the logFields for this task err defines whether the taskProgressMsg's Status is SUCCESS or FAILURE
func CountLines ¶
func CreateTmpDir ¶
CreateTmpDir creates a new temporary directory in the directory dir with a name beginning with prefix and returns the path of the new directory. If dir is the empty string, CreateTmpDir uses the default directory for temporary files (see os.TempDir).
func CreateTmpFile ¶
CreateTmpFile creates a new temporary file in the directory dir with a name beginning with prefix, and a content string. If dir is the empty string, CreateTmpFile uses the default directory for temporary files (see os.TempDir). This method will return the path of the created file. It will panic in case of failure creating or writing to the file.
func GetFailureTypeFromError ¶
func GetFailureTypeFromError(err error) taskpb.FailureType
GetFailureTypeFromError attempts to identify the passed in error and returns a taskpb.FailureType.
func GetGCSGenerationNumCondition ¶
func GetGCSGenerationNumCondition(generationNum int64) storage.Conditions
func IsValidFailureMsg ¶
func IsValidFailureMsg(taskRelRsrcName string, failureType taskpb.FailureType, taskRespMsg *taskpb.TaskRespMsg) (bool, string)
func IsValidSuccessMsg ¶
func IsValidSuccessMsg(taskRelRsrcName string, taskRespMsg *taskpb.TaskRespMsg) (bool, string)
func NewStringReadCloser ¶
func NewStringReadCloser(s string) *stringReadCloser
Types ¶
type AgentError ¶
type AgentError struct { Msg string FailureType taskpb.FailureType }
func (AgentError) Error ¶
func (ae AgentError) Error() string
type StringWriteCloser ¶
type StringWriteCloser struct {
// contains filtered or unexported fields
}
StringWriteCloser implements WriteCloser interface for faking storage.Writer.
func NewStringWriteCloser ¶
func NewStringWriteCloser(attrs *storage.ObjectAttrs) *StringWriteCloser
func (*StringWriteCloser) Attrs ¶
func (m *StringWriteCloser) Attrs() *storage.ObjectAttrs
func (*StringWriteCloser) Close ¶
func (m *StringWriteCloser) Close() error
func (*StringWriteCloser) CloseWithError ¶
func (m *StringWriteCloser) CloseWithError(err error) error
func (*StringWriteCloser) NumberLines ¶
func (m *StringWriteCloser) NumberLines() int64
func (*StringWriteCloser) WrittenString ¶
func (m *StringWriteCloser) WrittenString() string