about summary refs log tree commit diff stats
path: root/html/baremetal/302stack_allocate.subx.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-02-21 12:07:37 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-02-21 12:07:37 -0800
commite78f801e72b1dfb0c505ebadf4d48cbaa0fff683 (patch)
tree4949cebfb93fe7783c99b395d231af98e152a799 /html/baremetal/302stack_allocate.subx.html
parent954fc11c18ade451cd3459158e3f97657fba2740 (diff)
downloadmu-e78f801e72b1dfb0c505ebadf4d48cbaa0fff683.tar.gz
7766
Diffstat (limited to 'html/baremetal/302stack_allocate.subx.html')
0 files changed, 0 insertions, 0 deletions
p;id=a3c67f1ff9ed2cff44930f6bfd17a3ec272fe2f5'>^
d62c82f ^
d6fbc25 ^


c831484 ^
cd635e6 ^


887c25e ^



69217dd ^
887c25e ^






893123c ^
8af4945 ^
920306c ^

887c25e ^


















f06a2d6 ^
747f4fb ^
df1d1ef ^







747f4fb ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
                                                      
 
        
                      

              

                                             
 
 
                      


                                           
 


                                  



                                                         
                                              






                                                                 
 
 

                                                       


















                                                  
 
 







                                                           



                                                          
package svc // import "github.com/getwtxt/getwtxt/svc"

import (
	"database/sql"
	"sync"
	"time"

	"github.com/syndtr/goleveldb/leveldb"
)

// content-type consts
const txtutf8 = "text/plain; charset=utf-8"
const htmlutf8 = "text/html; charset=utf-8"
const cssutf8 = "text/css; charset=utf-8"

// Configuration object definition
type Configuration struct {
	Mu            sync.RWMutex
	Port          int           `yaml:"ListenPort"`
	LogFile       string        `yaml:"LogFile"`
	DBType        string        `yaml:"DatabaseType"`
	DBPath        string        `yaml:"DatabasePath"`
	AssetsDir     string        `yaml:"-"`
	StdoutLogging bool          `yaml:"StdoutLogging"`
	Version       string        `yaml:"-"`
	CacheInterval time.Duration `yaml:"StatusFetchInterval"`
	DBInterval    time.Duration `yaml:"DatabasePushInterval"`
	LastCache     time.Time     `yaml:"-"`
	LastPush      time.Time     `yaml:"-"`
	Instance      `yaml:"Instance"`
}

// Instance refers to this specific instance of getwtxt
type Instance struct {
	Vers  string `yaml:"-"`
	Name  string `yaml:"Instance.SiteName"`
	URL   string `yaml:"Instance.URL"`
	Owner string `yaml:"Instance.OwnerName"`
	Mail  string `yaml:"Instance.Email"`
	Desc  string `yaml:"Instance.Description"`
}

type dbLevel struct {
	db *leveldb.DB
}

type dbSqlite struct {
	db *sql.DB
}

type dbase interface {
	push() error
	pull()
}

// RemoteRegistries holds a list of remote registries to
// periodically scrape for new users. The remote registries
// must have been added via POST like a user.
type RemoteRegistries struct {
	Mu   sync.RWMutex
	List []string
}

// ipCtxKey is the Context value key for user IP addresses
type ipCtxKey int

const ctxKey ipCtxKey = iota