github.com/voedger/voedger@v0.0.0-20240520144910-273e84102129/cmd/vpm/const.go (about)

     1  /*
     2   * Copyright (c) 2023-present unTill Pro, Ltd.
     3   * @author Alisher Nurmanov
     4   */
     5  
     6  package main
     7  
     8  const (
     9  	wasmDirName          = "wasm"
    10  	buildDirName         = "build"
    11  	ormDirName           = "orm"
    12  	pkgDirName           = "pkg"
    13  	baselineInfoFileName = "baseline.json"
    14  	timestampFormat      = "Mon, 02 Jan 2006 15:04:05.000 GMT"
    15  	errFmtCopyFile       = "'%s': failed to copy - %w"
    16  )
    17  
    18  const (
    19  	sysContent = `// Code generated by vpm. DO NOT EDIT.
    20  
    21  package orm
    22  
    23  import "github.com/voedger/voedger/pkg/exttinygo"
    24  
    25  type QName = string
    26  type Ref int64
    27  func (r Ref) ID() ID { return ID(r) }
    28  type ID int64
    29  type Bytes []byte
    30  
    31  const (
    32  	FieldNameEventUnloggedArgumentObject = "UnloggedArgumentObject"
    33  	FieldNameEventArgumentObject = "ArgumentObject"
    34  	FieldNameSysID               = "sys.ID"
    35  )
    36  
    37  type Type struct {
    38  	qname QName
    39  }
    40  
    41  func (t *Type) QName() QName {
    42  	return t.qname
    43  }
    44  
    45  type Event struct{}
    46  type Value_CommandContext struct{ tv exttinygo.TValue }
    47  
    48  func CommandContext() Value_CommandContext {
    49  	kb := exttinygo.KeyBuilder(exttinygo.StorageCommandContext, exttinygo.NullEntity)
    50  	return Value_CommandContext{tv: exttinygo.MustGetValue(kb)}
    51  }
    52  `
    53  	unknownType                  = "Unknown"
    54  	defaultOrmFilesHeaderComment = "// Code generated by vpm. DO NOT EDIT."
    55  	errInGeneratingOrmFileFormat = "error occurred while generating %s: %w"
    56  )
    57  
    58  const (
    59  	goModFileName                       = "go.mod"
    60  	goSumFileName                       = "go.sum"
    61  	packagesGenFileName                 = "packages_gen.go"
    62  	packagePathIsNotDeterminedErrFormat = "vpm: cannot determine module path for source directory %s"
    63  	minimalRequiredGoVersion            = "1.18"
    64  	unsupportedGoVersionErrFormat       = "vpm: unsupported go version %s, minimal required go version is " + minimalRequiredGoVersion
    65  	goModContentTemplate                = `module %s
    66  
    67  go %s
    68  `
    69  	packagesGenContentTemplate = defaultOrmFilesHeaderComment + `
    70  
    71  package %s
    72  
    73  import (
    74  	%s
    75  	_ "github.com/voedger/voedger/pkg/sys"
    76  )
    77  
    78  func init() {
    79  	return
    80  }
    81  `
    82  )