Documentation ¶
Index ¶
- Variables
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetArticManifestURL() string
- func (x *Config) GetCreated() *timestamp.Timestamp
- func (x *Config) GetFileformat() string
- func (x *Config) GetFilepath() string
- func (config *Config) GetJSONDump() string
- func (x *Config) GetServerlog() string
- func (x *Config) GetUser() *User
- func (x *Config) GetVersion() string
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (x *Config) String() string
- func (config *Config) Write() error
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultConfigName is the default config file name. DefaultConfigName = "herald-config" // DefaultConfigType of file for the config file. DefaultConfigType = "json" // DefaultConfigDir is the default location for the config file. DefaultConfigDir = getHome() // DefaultConfigPath for the config file. DefaultConfigPath = fmt.Sprintf("%s/%s.%s", DefaultConfigDir, DefaultConfigName, DefaultConfigType) // DefaultServerlog file path. DefaultServerlog = fmt.Sprintf("%s/herald-server.log", DefaultConfigDir) // DefaultManifestURL for the ARTIC primer schemes. DefaultManifestURL = "https://raw.githubusercontent.com/artic-network/primer-schemes/master/schemes_manifest.json" // ErrInvalidPath is used when the config file path is bad or doesn't exist. ErrInvalidPath = fmt.Errorf("invalid config filepath") // DefaultConfig is the basic info, filled on first run of Herald. DefaultConfig = &Config{ Filepath: DefaultConfigPath, Fileformat: DefaultConfigType, User: &User{}, Version: version.VERSION, Serverlog: DefaultServerlog, ArticManifestURL: DefaultManifestURL, } )
View Source
var File_herald_config_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Created *timestamp.Timestamp `protobuf:"bytes,1,opt,name=created,proto3" json:"created,omitempty"` Filepath string `protobuf:"bytes,2,opt,name=filepath,proto3" json:"filepath,omitempty"` // filepath to config Fileformat string `protobuf:"bytes,3,opt,name=fileformat,proto3" json:"fileformat,omitempty"` // the fileformat of the config on disk Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` // version of Herald used User *User `protobuf:"bytes,5,opt,name=user,proto3" json:"user,omitempty"` // user details Serverlog string `protobuf:"bytes,6,opt,name=serverlog,proto3" json:"serverlog,omitempty"` // filepath to logfile ArticManifestURL string `protobuf:"bytes,7,opt,name=articManifestURL,proto3" json:"articManifestURL,omitempty"` // url of the ARTIC manifest for primer schemes // contains filtered or unexported fields }
Config is used to describe a Herald instance.
func InitConfig ¶
InitConfig reads in the config file or generates a new one if not found.
It will return a pointer to a copy of the config in memory.
NOTE: any updates to the returned config will need to be written back to the file on disk by the user.
func (*Config) Descriptor
deprecated
func (*Config) GetArticManifestURL ¶
func (*Config) GetCreated ¶
func (*Config) GetFileformat ¶
func (*Config) GetFilepath ¶
func (*Config) GetJSONDump ¶
GetJSONDump returns a string dump of the config in JSON
func (*Config) GetServerlog ¶
func (*Config) GetVersion ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
type User ¶
type User struct { Created *timestamp.Timestamp `protobuf:"bytes,1,opt,name=created,proto3" json:"created,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` // contains filtered or unexported fields }
User is used to identify the owner of HeraldData.
func (*User) Descriptor
deprecated
func (*User) GetCreated ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.